Class PromiseUtil

java.lang.Object
org.forgerock.openig.util.PromiseUtil

public final class PromiseUtil extends Object
Utility class for promises management.
  • Method Details

    • consumeIfPresent

      public static <T> ResultHandler<T> consumeIfPresent(Consumer<T> consumer)
      Execute the consumer if result is not null.
      Type Parameters:
      T - The object type to handle
      Parameters:
      consumer - a consumer for the expected result.
      Returns:
      a ResultHandler that consumes the promised result.