Policy class final

The aggregate containing all loaded RoleEntity objects.

Provides immutable operations that return new Policy instances.

Annotations

Constructors

Policy({required Map<String, RoleEntity> roles})
Creates a Policy from a map of role name strings to RoleEntity.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
isEmpty → bool
Returns true when no roles have been loaded.
no setter
isNotEmpty → bool
Returns true when at least one role is present.
no setter
roles → Map<String, RoleEntity>
An unmodifiable view of all roles keyed by role name.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

merge(Policy other) → Policy
Returns a new Policy that merges other into this one.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
roleFor(String roleName) → RoleEntity?
Returns the RoleEntity for roleName, or null if not found.
toString() → String
A string representation of this object.
inherited
withoutRole(String roleName) → Policy
Returns a new Policy with the role named roleName removed.
withRole(RoleEntity role) → Policy
Returns a new Policy with role added or replaced.

Operators

operator ==(Object other) → bool
The equality operator.
inherited