Package com.koralix.stepfn
Class SyncStepFunction<T,R>
java.lang.Object
com.koralix.stepfn.StepFunction<T,R,R>
com.koralix.stepfn.SyncStepFunction<T,R>
- Type Parameters:
T
- the type of the input to the functionR
- the type of the result of the function
- All Implemented Interfaces:
Function<T,
R>
A
StepFunction
that computes its result synchronously.
Check the StepFunction
documentation for more information and examples.
- Since:
- 1.0.0
- See Also:
-
Constructor Summary
ConstructorDescriptionSyncStepFunction
(Step<T, ?> initialStep) Creates a newSyncStepFunction
with the given initial step.SyncStepFunction
(Step<T, ?> initialStep, Map<Step<?, ?>, Set<Transition<?, ?>>> transitions) Deprecated. -
Method Summary
Methods inherited from class com.koralix.stepfn.StepFunction
addTransition, addTransition, apply, firstStep, transitions
-
Constructor Details
-
SyncStepFunction
@Deprecated public SyncStepFunction(Step<T, ?> initialStep, Map<Step<?, ?>, Set<Transition<?, ?>>> transitions) Deprecated.useSyncStepFunction(Step)
instead - this constructor will be removed in 1.2.0Creates a newSyncStepFunction
with the given initial step and transitions.- Parameters:
initialStep
- the initial steptransitions
- the transitions- Since:
- 1.0.0
-
SyncStepFunction
Creates a newSyncStepFunction
with the given initial step.- Parameters:
initialStep
- the initial step- Since:
- 1.0.0
-
-
Method Details
-
apply
Applies this function to the given argument.- Parameters:
t
- the function argument- Returns:
- the function result
- Since:
- 1.0.0
-
step
Applies the givenStep
to the given input.If the
Step
is complete, the result is returned in a completedCompletableFuture
.If the step is not complete, an empty
Optional
is returned and the input is aggregated.- Specified by:
step
in classStepFunction<T,
R, R> - Type Parameters:
A
- the input type of the stepB
- the output type of the step- Parameters:
step
- the step to applyfrom
- the step from which the input was receivedinput
- the input to the step- Returns:
- the result of the step in a completed
CompletableFuture
if the step is complete, an emptyOptional
otherwise - Since:
- 1.0.0
-
SyncStepFunction(Step)
instead - this constructor will be removed in 1.2.0