Class QueryFutureAdapter<T>

java.lang.Object
septogeddon.pluginquery.QueryFutureAdapter<T>
All Implemented Interfaces:
QueryFuture<T>
Direct Known Subclasses:
QueryChannelFuture, QueryCompletableFuture

public abstract class QueryFutureAdapter<T> extends Object implements QueryFuture<T>
  • Field Details

    • result

      protected T result
    • cause

      protected Throwable cause
    • done

      protected boolean done
  • Constructor Details

    • QueryFutureAdapter

      public QueryFutureAdapter()
  • Method Details

    • complete

      public void complete(T result)
    • fireEvent

      public void fireEvent()
    • completeExceptionally

      public void completeExceptionally(Throwable cause)
    • isDone

      public boolean isDone()
      Description copied from interface: QueryFuture
      Check whether the task is done executed no matter what happen to the task
      Specified by:
      isDone in interface QueryFuture<T>
      Returns:
    • isSuccess

      public boolean isSuccess()
      Description copied from interface: QueryFuture
      Check whether the task is successfully executed
      Specified by:
      isSuccess in interface QueryFuture<T>
      Returns:
    • getCause

      public Throwable getCause()
      Description copied from interface: QueryFuture
      An error that caused the task failed to do its job
      Specified by:
      getCause in interface QueryFuture<T>
      Returns:
    • getResult

      public T getResult()
      Description copied from interface: QueryFuture
      A result from current finished task
      Specified by:
      getResult in interface QueryFuture<T>
      Returns:
    • addListener

      public void addListener(Consumer<QueryFuture<T>> listener)
      Description copied from interface: QueryFuture
      Add future listener
      Specified by:
      addListener in interface QueryFuture<T>
      Parameters:
      listener -
    • removeListener

      public void removeListener(Consumer<QueryFuture<T>> listener)
      Description copied from interface: QueryFuture
      Remove future listener
      Specified by:
      removeListener in interface QueryFuture<T>
      Parameters:
      listener -