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
truewhen no roles have been loaded.no setter - isNotEmpty → bool
-
Returns
truewhen 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
otherinto 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, ornullif not found. -
toString(
) → String -
A string representation of this object.
inherited
-
withoutRole(
String roleName) → Policy -
Returns a new Policy with the role named
roleNameremoved. -
withRole(
RoleEntity role) → Policy -
Returns a new Policy with
roleadded or replaced.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited