Class SettableFuture<V>

  • All Implemented Interfaces:
    ListenableFuture<V>, java.util.concurrent.Future<V>

    @Deprecated(since="2022-12-01")
    public final class SettableFuture<V>
    extends AbstractFuture<V>
    Deprecated.
    The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023
    A ListenableFuture whose result may be set by a set(Object) or setException(Throwable) call. It may also be cancelled.
    Since:
    9.0 (in 1.0 as ValueFuture)
    • Method Detail

      • create

        public static <V> SettableFuture<V> create()
        Deprecated.
        Creates a new SettableFuture in the default state.
      • set

        public boolean set​(@Nullable
                           V value)
        Deprecated.
        Sets the value of this future. This method will return true if the value was successfully set, or false if the future has already been set or cancelled.
        Parameters:
        value - the value the future should hold.
        Returns:
        true if the value was successfully set.
      • setException

        public boolean setException​(java.lang.Throwable throwable)
        Deprecated.
        Sets the future to having failed with the given exception. This exception will be wrapped in an ExecutionException and thrown from the get methods. This method will return true if the exception was successfully set, or false if the future has already been set or cancelled.
        Parameters:
        throwable - the exception the future should hold.
        Returns:
        true if the exception was successfully set.