Class PromiseUtil


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

      • 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.