RoleData<D extends Object> class
final
Data for a role in the role's own language, such as the routes of a feature for the router role.
The type D is the data type of role, and a role with no data has the
data type NoDsl, so no data can be created for it. Hooks of the role
and its providers receive the data of all modules in the order the modules
were selected (see RoleHookInput.data).
A module may contribute data only to its own roles (see ModuleDescriptor.roles). Data applies only when role is present, in addition to when, so a module that only uses a role can contribute data to it unconditionally; hooks and rules never see data that does not apply.
Data can depend on what other roles chose (whenChosen), but not on
what role chooses, since role chooses from its data. The choose
hook of role then runs after those of the roles of the conditions, and
gets the data only where every condition holds, as the render hooks do;
validation and the module rules take it as data that applies.
Prefer Role.data to the constructor: it takes a value of the role's data type only, while the constructor also accepts a wider type argument that fails only at run time.
- Inheritance
-
- Object
- Contribution
- RoleData
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- origin → ContributionOrigin?
-
Who contributed the data.
final
-
role
→ Role<
D> -
The role the data is for.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → D
-
The data.
final
-
when
→ Set<
Role< Object> > -
Roles that must all be present for the contribution to apply.
finalinherited
-
whenChosen
→ Set<
ChoiceCondition> -
Conditions on what roles chose, which must all hold for the
contribution to apply, besides when; see ChoiceCondition.
finalinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
withOrigin(
ContributionOrigin origin) → RoleData< D> -
Returns a copy of this data contributed by
origin.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited