Class Async

java.lang.Object
com.github.benmanes.caffeine.cache.Async

final class Async extends Object
Static utility methods and classes pertaining to asynchronous operations.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    (package private) static final class 
    An expiry for asynchronous computations.
    (package private) static final class 
    A removal listener that asynchronously forwards the value stored in a CompletableFuture if successful to the user-supplied removal listener.
    (package private) static final class 
    A weigher for asynchronous computations.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final long
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static <V> @Nullable V
    getIfReady(@Nullable CompletableFuture<V> future)
    Returns the current value or null if either not done or failed.
    (package private) static <V> @Nullable V
    getWhenSuccessful(@Nullable CompletableFuture<V> future)
    Returns the value when completed successfully or null if failed.
    (package private) static boolean
    isReady(@Nullable CompletableFuture<?> future)
    Returns if the future has successfully completed.

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • Async

      private Async()
  • Method Details

    • isReady

      static boolean isReady(@Nullable CompletableFuture<?> future)
      Returns if the future has successfully completed.
    • getIfReady

      static <V> @Nullable V getIfReady(@Nullable CompletableFuture<V> future)
      Returns the current value or null if either not done or failed.
    • getWhenSuccessful

      static <V> @Nullable V getWhenSuccessful(@Nullable CompletableFuture<V> future)
      Returns the value when completed successfully or null if failed.