Class NoOpAsyncResult

java.lang.Object
org.apache.qpid.protonj2.client.futures.NoOpAsyncResult
All Implemented Interfaces:
AsyncResult<Void>

public class NoOpAsyncResult extends Object implements AsyncResult<Void>
Simple NoOp implementation used when the result of the operation does not matter.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final NoOpAsyncResult
    A singleton instance of the NoOpAsyncResult for use in client operation.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    complete(Void result)
    If the operation succeeds the resulting value produced is set to null and the waiting parties are signaled.
    void
    If the operation fails this method is invoked with the Exception that caused the failure.
    boolean
    Returns true if the AsyncResult has completed.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • INSTANCE

      public static final NoOpAsyncResult INSTANCE
      A singleton instance of the NoOpAsyncResult for use in client operation.
  • Constructor Details

    • NoOpAsyncResult

      public NoOpAsyncResult()
  • Method Details

    • failed

      public void failed(ClientException result)
      Description copied from interface: AsyncResult
      If the operation fails this method is invoked with the Exception that caused the failure.
      Specified by:
      failed in interface AsyncResult<Void>
      Parameters:
      result - The error that resulted in this asynchronous operation failing.
    • complete

      public void complete(Void result)
      Description copied from interface: AsyncResult
      If the operation succeeds the resulting value produced is set to null and the waiting parties are signaled.
      Specified by:
      complete in interface AsyncResult<Void>
      Parameters:
      result - the object that completes the future.
    • isComplete

      public boolean isComplete()
      Description copied from interface: AsyncResult
      Returns true if the AsyncResult has completed. The task is considered complete regardless if it succeeded or failed.
      Specified by:
      isComplete in interface AsyncResult<Void>
      Returns:
      returns true if the asynchronous operation has completed.