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 java.lang.Object
A helper class to filterMissionState
based onPredicate
ofRunState
provided
-
-
Constructor Summary
Constructors Constructor Description ReturnHelper(java.util.function.Function<io.molr.commons.domain.MissionState,T> function)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
when(java.util.function.Predicate<io.molr.commons.domain.RunState> runStateValidator)
Returns the output ofFunction
applied onMissionState
filtered fromRunState
Predicate
T
when(java.util.function.Predicate<io.molr.commons.domain.RunState> runStateValidator, java.time.Duration timeout)
Returns the output ofFunction
applied onMissionState
filtered fromRunState
Predicate
with a timeoutT
whenFinished()
Returns the output ofFunction
applied onMissionState
filtered whenRunState
is FINISHEDT
whenFinished(java.time.Duration timeout)
Returns the output ofFunction
applied onMissionState
filtered whenRunState
is FINISHED with a timeoutT
whenPaused()
Returns the output ofFunction
applied onMissionState
filtered whenRunState
is PAUSEDT
whenPaused(java.time.Duration timeout)
Returns the output ofFunction
applied onMissionState
filtered whenRunState
is PAUSED with a timeout
-
-
-
Constructor Detail
-
ReturnHelper
public ReturnHelper(java.util.function.Function<io.molr.commons.domain.MissionState,T> function)
- Parameters:
function
- theFunction
to apply onMissionState
-
-
Method Detail
-
when
public T when(java.util.function.Predicate<io.molr.commons.domain.RunState> runStateValidator)
Returns the output ofFunction
applied onMissionState
filtered fromRunState
Predicate
- Parameters:
runStateValidator
- aPredicate
forRunState
- Returns:
- the return value
OngoingMissionRun.ReturnHelper
-
when
public T when(java.util.function.Predicate<io.molr.commons.domain.RunState> runStateValidator, java.time.Duration timeout)
Returns the output ofFunction
applied onMissionState
filtered fromRunState
Predicate
with a timeout- Parameters:
runStateValidator
- aPredicate
forRunState
timeout
- the timeout before onNext signal- Returns:
- the return value
OngoingMissionRun.ReturnHelper
-
whenFinished
public T whenFinished()
Returns the output ofFunction
applied onMissionState
filtered whenRunState
is FINISHED- Returns:
- the return value
OngoingMissionRun.ReturnHelper
-
whenFinished
public T whenFinished(java.time.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
OngoingMissionRun.ReturnHelper
-
whenPaused
public T whenPaused()
Returns the output ofFunction
applied onMissionState
filtered whenRunState
is PAUSED- Returns:
- the return value
OngoingMissionRun.ReturnHelper
-
whenPaused
public T whenPaused(java.time.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
OngoingMissionRun.ReturnHelper
-
-