Package org.apache.hc.client5.http.impl
Class Operations
- java.lang.Object
-
- org.apache.hc.client5.http.impl.Operations
-
public final class Operations extends java.lang.Object
Common cancellable operations.- Since:
- 5.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Operations.CompletedFuture<T>
This class represents aFuture
in the completed state with a fixed result.
-
Field Summary
Fields Modifier and Type Field Description private static org.apache.hc.core5.concurrent.Cancellable
NOOP_CANCELLABLE
-
Constructor Summary
Constructors Constructor Description Operations()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.hc.core5.concurrent.Cancellable
cancellable(java.util.concurrent.Future<?> future)
Creates aCancellable
operation handle for an ongoing process or operation represented by aFuture
.static org.apache.hc.core5.concurrent.Cancellable
nonCancellable()
Creates aCancellable
operation handle for an ongoing process or operation that cannot be cancelled.
-
-
-
Method Detail
-
nonCancellable
public static org.apache.hc.core5.concurrent.Cancellable nonCancellable()
Creates aCancellable
operation handle for an ongoing process or operation that cannot be cancelled. Attempts to cancel the operation with this handle will have no effect.- Returns:
- the no-op cancellable operation handle.
-
cancellable
public static org.apache.hc.core5.concurrent.Cancellable cancellable(java.util.concurrent.Future<?> future)
Creates aCancellable
operation handle for an ongoing process or operation represented by aFuture
.- Parameters:
future
- the result future- Returns:
- the cancellable operation handle.
-
-