Class 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 filter MissionState based on Predicate of RunState 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 of Function applied on MissionState filtered from RunState Predicate
      T when​(java.util.function.Predicate<io.molr.commons.domain.RunState> runStateValidator, java.time.Duration timeout)
      Returns the output of Function applied on MissionState filtered from RunState Predicate with a timeout
      T whenFinished()
      Returns the output of Function applied on MissionState filtered when RunState is FINISHED
      T whenFinished​(java.time.Duration timeout)
      Returns the output of Function applied on MissionState filtered when RunState is FINISHED with a timeout
      T whenPaused()
      Returns the output of Function applied on MissionState filtered when RunState is PAUSED
      T whenPaused​(java.time.Duration timeout)
      Returns the output of Function applied on MissionState filtered when RunState is PAUSED with a timeout
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ReturnHelper

        public ReturnHelper​(java.util.function.Function<io.molr.commons.domain.MissionState,​T> function)
        Parameters:
        function - the Function to apply on MissionState
    • Method Detail

      • when

        public T when​(java.util.function.Predicate<io.molr.commons.domain.RunState> runStateValidator)
        Returns the output of Function applied on MissionState filtered from RunState Predicate
        Parameters:
        runStateValidator - a Predicate for RunState
        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 of Function applied on MissionState filtered from RunState Predicate with a timeout
        Parameters:
        runStateValidator - a Predicate for RunState
        timeout - the timeout before onNext signal
        Returns:
        the return value OngoingMissionRun.ReturnHelper
      • whenFinished

        public T whenFinished()
        Returns the output of Function applied on MissionState filtered when RunState is FINISHED
        Returns:
        the return value OngoingMissionRun.ReturnHelper
      • whenFinished

        public T whenFinished​(java.time.Duration timeout)
        Returns the output of Function applied on MissionState filtered when RunState 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 of Function applied on MissionState filtered when RunState is PAUSED
        Returns:
        the return value OngoingMissionRun.ReturnHelper
      • whenPaused

        public T whenPaused​(java.time.Duration timeout)
        Returns the output of Function applied on MissionState filtered when RunState is PAUSED with a timeout
        Parameters:
        timeout - the timeout before onNext signal
        Returns:
        the return value OngoingMissionRun.ReturnHelper