ResponsibilityChainWithArgs<R, A> class

In contrast to the ResponsibilityChain, this class allows to pass the argument of type A to its handle method. This argument will be passed to every handler node in the chain.

For other features, see the ResponsibilityChain documentation.

Implementers

Constructors

ResponsibilityChainWithArgs({required ParametrizedSupplier<R, A> orElse})

Properties

hashCode → int
The hash code for this object.
no setterinherited
nodes → List<IResponsibilityNode<R, A>>
The list of nodes that are currently chained to this responsibility chain.
final
orElse → ParametrizedSupplier<R, A>
The function that returns the default value of type R.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

chain(IResponsibilityNode<R, A> node) → void
Adds a given node to this chain.
handle(A 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.
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