Class BiFunctions

    • Method Detail

      • coalesce

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