ResponsibilityChain<R> class
A class providing the functionality for chaining responsibility handler nodes together and controlling the responsibility distribution between the linked nodes. The orElse function returns the value that should be returned when none of the responsibility handlers succeed to return the result.
Nodes of responsibility are lazily created and executed in the precise order in which they are chained.
The type parameter R represents the type of the result returned by the chain.
- Inheritance
-
- Object
- ResponsibilityChainWithArgs<
R, void> - ResponsibilityChain
Constructors
-
ResponsibilityChain({required ParametrizedSupplier<
R, void> orElse})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
nodes
→ List<
IResponsibilityNode< R, void> > -
The list of nodes that are currently chained to this responsibility chain.
finalinherited
-
orElse
→ ParametrizedSupplier<
R, void> -
The function that returns the default value of type
R.finalinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
chain(
IResponsibilityNode< R, void> node) → void -
Adds a given
nodeto this chain.inherited -
handle(
[void args]) → Future< R> -
This method iterates through the chained nodes in the precise order they had been chained and
calls the IResponsibilityNodes with the argument
arg.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited