ChainStep<Input, Output> class
abstract
Base class for all chain processing steps that defines type-safe data transformation and error handling behavior.
Key features:
- Type-safe input/output handling
- Asynchronous processing support
- Error handling with rollback
- Extensible through mixins
Example:
class ValidationStep extends ChainStep<RequestData, RequestData> {
@override
Future<RequestData> handle(RequestData data, ChainContext context) async {
if (!isValid(data)) throw ValidationError();
return data;
}
@override
Future<void> rollback(RequestData data, ChainContext context) async {
// Cleanup logic
}
}
- Implementers
Constructors
- ChainStep()
-
Base class for all chain processing steps that defines type-safe data transformation
and error handling behavior.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- inputType → Type
-
Type of input data this step accepts
no setter
- outputType → Type
-
Type of output data this step produces
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
handle(
Input data, ChainContext context) → FutureOr< Output> - Handles the input data and produces output
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
rollback(
Input data, ChainContext context) → FutureOr< void> - Optional rollback logic for the step
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited