org.apache.hc.client5.http.impl

## Class Operations.CompletedFuture<T>

- java.lang.Object
- - org.apache.hc.client5.http.impl.Operations.CompletedFuture<T>

- Type Parameters:
    `T` - operation result representation.
  All Implemented Interfaces:
    Future<T>
  Enclosing class:
    Operations

      public static class Operations.CompletedFuture<T>
      extends Object
      implements Future<T>

  This class represents a `Future` in the completed state with a fixed result. The outcome of the future cannot be altered and it cannot be cancelled.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Operations.CompletedFuture(T result)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `cancel(boolean mayInterruptIfRunning)`
    `T` | `get()`
    `T` | `get(long timeout, TimeUnit unit)`
    `boolean` | `isCancelled()`
    `boolean` | `isDone()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Operations.CompletedFuture

          public Operations.CompletedFuture(T result)

  - ### Method Detail

    - #### get

          public T get()
                throws InterruptedException,
                       ExecutionException

      Specified by:
        `get` in interface `Future<T>`
      Throws:
        `InterruptedException`
        `ExecutionException`

    - #### get

          public T get(long timeout,
              TimeUnit unit)
                throws InterruptedException,
                       ExecutionException,
                       TimeoutException

      Specified by:
        `get` in interface `Future<T>`
      Throws:
        `InterruptedException`
        `ExecutionException`
        `TimeoutException`

    - #### cancel

          public boolean cancel(boolean mayInterruptIfRunning)

      Specified by:
        `cancel` in interface `Future<T>`

    - #### isCancelled

          public boolean isCancelled()

      Specified by:
        `isCancelled` in interface `Future<T>`

    - #### isDone

          public boolean isDone()

      Specified by:
        `isDone` in interface `Future<T>`

Copyright © 1999–2022 The Apache Software Foundation. All rights reserved.