Interface FutureProgress<V>

  • Type Parameters:
    V - Type of value that can be retrieved if the operation succeeds.
    All Superinterfaces:
    Future<V>

    public interface FutureProgress<V>
    extends Future<V>
    A Future that reports on its current progress towards completion.
    See Also:
    Future
    • Method Detail

      • addProgressListener

        Future<V> addProgressListener​(FutureProgress.Listener listener)
        Sets progress listener, replacing any previously set such.
        Parameters:
        listener - Receiver of progress updates.
        Returns:
        This future, cast to Future.
        Throws:
        java.lang.NullPointerException - If listener is null.
      • done

        static FutureProgress<?> done()
        Creates new ProgressFuture that always succeeds with null.
        Returns:
        New Future.
      • success

        static <V> FutureProgress<V> success​(V value)
        Creates new ProgressFuture that always succeeds with value.
        Type Parameters:
        V - Type of value.
        Parameters:
        value - Value to wrap in Future.
        Returns:
        New Future.
      • failure

        static <V> FutureProgress<V> failure​(java.lang.Throwable error)
        Creates new ProgressFuture that always fails with error.
        Type Parameters:
        V - Type of value that would have been wrapped if successful.
        Parameters:
        error - Error to wrap in Future.
        Returns:
        New Future.