Class OortObject.Result.Deferred<D>

    • Constructor Summary

      Constructors 
      Constructor Description
      Deferred()  
    • Method Summary

      Modifier and Type Method Description
      D get​(long time, java.util.concurrent.TimeUnit unit)
      Waits for the result to be available for the specified amount of time.
      void onResult​(D result)
      Callback method invoked when the result is available.
      • Methods inherited from class java.lang.Object

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

      • Deferred

        public Deferred()
    • Method Detail

      • onResult

        public void onResult​(D result)
        Description copied from interface: OortObject.Result

        Callback method invoked when the result is available.

        Specified by:
        onResult in interface OortObject.Result<D>
        Parameters:
        result - the result object
      • get

        public D get​(long time,
                     java.util.concurrent.TimeUnit unit)
              throws java.lang.InterruptedException,
                     java.util.concurrent.TimeoutException

        Waits for the result to be available for the specified amount of time.

        If the wait time elapses, a TimeoutException is thrown, but this method can be called again to wait more time for the result.

        Parameters:
        time - the maximum time to wait
        unit - the time unit
        Returns:
        the result if available, otherwise an exception is thrown
        Throws:
        java.lang.InterruptedException - if the thread is interrupted while waiting
        java.util.concurrent.TimeoutException - if the time elapses before the result is available