public class DefaultObjectiveContext extends Object implements ObjectiveContext
| Constructor and Description |
|---|
DefaultObjectiveContext(BiConsumer<Objective,ObjectiveError> onError)
Creates a new objective context using the given error consumer.
|
DefaultObjectiveContext(Consumer<Objective> onSuccess)
Creates a new objective context using the given success consumer.
|
DefaultObjectiveContext(Consumer<Objective> onSuccess,
BiConsumer<Objective,ObjectiveError> onError)
Creates a new objective context using the given success and error
consumers.
|
| Modifier and Type | Method and Description |
|---|---|
void |
onError(Objective objective,
ObjectiveError error)
Invoked when error is encountered while executing the flow objective.
|
void |
onSuccess(Objective objective)
Invoked on successful execution of the flow objective.
|
public DefaultObjectiveContext(Consumer<Objective> onSuccess, BiConsumer<Objective,ObjectiveError> onError)
onSuccess - consumer to be called on successonError - consumer to be called on errorpublic DefaultObjectiveContext(Consumer<Objective> onSuccess)
onSuccess - consumer to be called on successpublic DefaultObjectiveContext(BiConsumer<Objective,ObjectiveError> onError)
onError - consumer to be called on errorpublic void onSuccess(Objective objective)
ObjectiveContextonSuccess in interface ObjectiveContextobjective - objective to executepublic void onError(Objective objective, ObjectiveError error)
ObjectiveContextonError in interface ObjectiveContextobjective - objective to executeerror - error encountered