Class RestconfFuture<V>
java.lang.Object
com.google.common.util.concurrent.internal.InternalFutureFailureAccess
com.google.common.util.concurrent.AbstractFuture<@NonNull V>
org.opendaylight.restconf.common.errors.RestconfFuture<V>
- Type Parameters:
V- resulting value type
- All Implemented Interfaces:
com.google.common.util.concurrent.ListenableFuture<V>,Future<V>
- Direct Known Subclasses:
SettableRestconfFuture
public sealed class RestconfFuture<V>
extends com.google.common.util.concurrent.AbstractFuture<@NonNull V>
permits SettableRestconfFuture<V>
A
ListenableFuture specialization, which fails only with RestconfDocumentedException and does not
produce null values.-
Method Summary
Modifier and TypeMethodDescriptionfinal @NonNull RestconfFuture<V>addCallback(RestconfCallback<? super V> callback) Add a callback to invoke when this future completes, or immediately if it is already complete.final booleancancel(boolean mayInterruptIfRunning) static <V> @NonNull RestconfFuture<V>final @NonNull VGet the result.static <V> @NonNull RestconfFuture<V>of(V value) final <T> @NonNull RestconfFuture<T>Transform the result of this future using the specified function.Methods inherited from class com.google.common.util.concurrent.AbstractFuture
addListener, afterDone, get, get, interruptTask, isCancelled, isDone, pendingToString, set, setException, setFuture, toString, tryInternalFastPathGetFailure, wasInterrupted
-
Method Details
-
of
-
failed
-
cancel
public final boolean cancel(boolean mayInterruptIfRunning) -
addCallback
Add a callback to invoke when this future completes, or immediately if it is already complete.- Parameters:
callback- Callback to invoke- Returns:
- This future
- Throws:
NullPointerException- ifcallbackisnull
-
transform
Transform the result of this future using the specified function.- Type Parameters:
T- Resulting type- Parameters:
function- Function to apply- Returns:
- Transformed future
- Throws:
NullPointerException- iffunctionisnull
-
getOrThrow
Get the result.- Returns:
- The result
- Throws:
RestconfDocumentedException- if this future failed or this call is interrupted.
-