Class Async
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.Async
-
final class Async extends java.lang.ObjectStatic utility methods and classes pertaining to asynchronous operations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classAsync.AsyncExpiry<K,V>An expiry for asynchronous computations.(package private) static classAsync.AsyncRemovalListener<K,V>A removal listener that asynchronously forwards the value stored in aCompletableFutureif successful to the user-supplied removal listener.(package private) static classAsync.AsyncWeigher<K,V>A weigher for asynchronous computations.
-
Field Summary
Fields Modifier and Type Field Description (package private) static longASYNC_EXPIRY
-
Constructor Summary
Constructors Modifier Constructor Description privateAsync()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static <V> @Nullable VgetIfReady(@Nullable java.util.concurrent.CompletableFuture<V> future)Returns the current value or null if either not done or failed.(package private) static <V> @Nullable VgetWhenSuccessful(@Nullable java.util.concurrent.CompletableFuture<V> future)Returns the value when completed successfully or null if failed.(package private) static booleanisReady(@Nullable java.util.concurrent.CompletableFuture<?> future)Returns if the future has successfully completed.
-
-
-
Field Detail
-
ASYNC_EXPIRY
static final long ASYNC_EXPIRY
- See Also:
- Constant Field Values
-
-
Method Detail
-
isReady
static boolean isReady(@Nullable java.util.concurrent.CompletableFuture<?> future)
Returns if the future has successfully completed.
-
getIfReady
static <V> @Nullable V getIfReady(@Nullable java.util.concurrent.CompletableFuture<V> future)
Returns the current value or null if either not done or failed.
-
getWhenSuccessful
static <V> @Nullable V getWhenSuccessful(@Nullable java.util.concurrent.CompletableFuture<V> future)
Returns the value when completed successfully or null if failed.
-
-