public class DefaultObjectiveContext extends java.lang.Object implements ObjectiveContext
Constructor and Description |
---|
DefaultObjectiveContext(java.util.function.BiConsumer<Objective,ObjectiveError> onError)
Creates a new objective context using the given error consumer.
|
DefaultObjectiveContext(java.util.function.Consumer<Objective> onSuccess)
Creates a new objective context using the given success consumer.
|
DefaultObjectiveContext(java.util.function.Consumer<Objective> onSuccess,
java.util.function.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(java.util.function.Consumer<Objective> onSuccess, java.util.function.BiConsumer<Objective,ObjectiveError> onError)
onSuccess
- consumer to be called on successonError
- consumer to be called on errorpublic DefaultObjectiveContext(java.util.function.Consumer<Objective> onSuccess)
onSuccess
- consumer to be called on successpublic DefaultObjectiveContext(java.util.function.BiConsumer<Objective,ObjectiveError> onError)
onError
- consumer to be called on errorpublic void onSuccess(Objective objective)
ObjectiveContext
onSuccess
in interface ObjectiveContext
objective
- objective to executepublic void onError(Objective objective, ObjectiveError error)
ObjectiveContext
onError
in interface ObjectiveContext
objective
- objective to executeerror
- error encountered