ConditionalStep<Input, Output> mixin
Adds conditional execution capability to a chain step.
Allows skipping step execution based on a condition. The condition can be based on input data, context state, or any other logic.
Example:
class ValidationStep extends ChainStep<Data, Data>
with ConditionalStep<Data, Data> {
@override
bool shouldExecute(Data data, ChainContext context) {
return data.needsValidation;
}
@override
FutureOr<Data> executeStep(Data data, ChainContext context) {
// Validation logic
return data.validate();
}
}
- Superclass constraints
- ChainStep<
Input, Output>
- ChainStep<
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- inputType → Type
-
Type of input data this step accepts
no setterinherited
- outputType → Type
-
Type of output data this step produces
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
executeStep(
Input data, ChainContext context) → FutureOr< Output> - Override this instead of handle
-
getSkipValue(
Input data) → Output - Value to return when step is skipped
-
handle(
Input data, ChainContext context) → FutureOr< Output> -
Handles the input data and produces output
override
-
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
inherited
-
shouldExecute(
Input data, ChainContext context) → bool - Whether the step should be executed
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited