Class Functions

    • Method Detail

      • coalesce

        public static <T,​R> Optional<R> coalesce​(T t,
                                                       Function<? super T,​? extends R>... functions)
        Lazily evaluates a set of functions, 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,​R,​Ex extends ThrowableOptional<R> coalesceE​(T t,
                                                                                   FunctionE<? super T,​? extends R,​? extends Ex>... functions)
                                                                            throws Ex extends Throwable
        Lazily evaluates a set of functions, 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