Class CompletedTask<V>

  • All Implemented Interfaces:
    ITask<V>, java.util.concurrent.Callable<V>, java.util.concurrent.Future<V>

    public class CompletedTask<V>
    extends java.lang.Object
    implements ITask<V>
    • Constructor Detail

      • CompletedTask

        public CompletedTask​(V value,
                             java.lang.Throwable throwable)
    • Method Detail

      • createFailed

        public static <V> ITask<V> createFailed​(java.lang.Throwable throwable)
      • create

        public static <V> ITask<V> create​(V value)
      • voidTask

        public static ITask<java.lang.Void> voidTask()
      • getCallable

        public java.util.concurrent.Callable<V> getCallable()
        Specified by:
        getCallable in interface ITask<V>
      • getDef

        public V getDef​(V def)
        Specified by:
        getDef in interface ITask<V>
      • get

        public V get​(long time,
                     java.util.concurrent.TimeUnit timeUnit,
                     V def)
        Specified by:
        get in interface ITask<V>
      • call

        public V call()
               throws java.lang.Exception
        Specified by:
        call in interface java.util.concurrent.Callable<V>
        Throws:
        java.lang.Exception
      • cancel

        public boolean cancel​(boolean b)
        Specified by:
        cancel in interface java.util.concurrent.Future<V>
      • isCancelled

        public boolean isCancelled()
        Specified by:
        isCancelled in interface java.util.concurrent.Future<V>
      • isDone

        public boolean isDone()
        Specified by:
        isDone in interface java.util.concurrent.Future<V>
      • get

        public V get()
        Specified by:
        get in interface java.util.concurrent.Future<V>
      • get

        public V get​(long l,
                     @NotNull
                     @NotNull java.util.concurrent.TimeUnit timeUnit)
        Specified by:
        get in interface java.util.concurrent.Future<V>