Package io.molr.mole.core.support
Class OngoingMissionRun.ReturnHelper<T>
- java.lang.Object
-
- io.molr.mole.core.support.OngoingMissionRun.ReturnHelper<T>
-
- Type Parameters:
T
- the type of value to be returned
- Enclosing class:
- OngoingMissionRun
public class OngoingMissionRun.ReturnHelper<T> extends Object
-
-
Constructor Summary
Constructors Constructor Description ReturnHelper(Function<MissionState,T> function)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
when(Predicate<RunState> runStateValidator)
T
when(Predicate<RunState> runStateValidator, Duration timeout)
Returns the output ofFunction
applied onMissionState
filtered fromRunState
Predicate
with a timeoutT
whenFinished()
T
whenFinished(Duration timeout)
Returns the output ofFunction
applied onMissionState
filtered whenRunState
is FINISHED with a timeoutT
whenPaused()
T
whenPaused(Duration timeout)
Returns the output ofFunction
applied onMissionState
filtered whenRunState
is PAUSED with a timeout
-
-
-
Constructor Detail
-
ReturnHelper
public ReturnHelper(Function<MissionState,T> function)
- Parameters:
function
- theFunction
to apply onMissionState
-
-
Method Detail
-
when
public T when(Predicate<RunState> runStateValidator, Duration timeout)
Returns the output ofFunction
applied onMissionState
filtered fromRunState
Predicate
with a timeout
-
whenFinished
public T whenFinished()
- Returns:
- the return value
-
whenFinished
public T whenFinished(Duration timeout)
Returns the output ofFunction
applied onMissionState
filtered whenRunState
is FINISHED with a timeout- Parameters:
timeout
- the timeout before onNext signal- Returns:
- the return value
-
whenPaused
public T whenPaused()
- Returns:
- the return value
-
whenPaused
public T whenPaused(Duration timeout)
Returns the output ofFunction
applied onMissionState
filtered whenRunState
is PAUSED with a timeout- Parameters:
timeout
- the timeout before onNext signal- Returns:
- the return value
-
-