Class Suppliers

    • Method Detail

      • coalesce

        public static <T> Optional<T> coalesce​(Supplier<? extends T>... suppliers)
        Lazily evaluates a set of suppliers, returning the first non-null result or Optional.EMPTY when no result.
        Returns:
        The first non-null result or Optional.EMPTY when all return null
      • coalesceE

        public static <T,​Ex extends ThrowableOptional<T> coalesceE​(SupplierE<? extends T,​? extends Ex>... suppliers)
                                                                    throws Ex extends Throwable
        Lazily evaluates a set of suppliers, returning the first non-null result or Optional.EMPTY when no result.
        Returns:
        The first non-null result or Optional.EMPTY when all return null
        Throws:
        Ex extends Throwable