Interface ISerializableThrowingBiFunction<T,​U,​R>

  • Type Parameters:
    T - the type of the first argument to the function
    U - the type of the second argument to the function
    R - the type of the result of the function
    All Superinterfaces:
    BiFunction<T,​U,​R>, IThrowingBiFunction<T,​U,​R>, Serializable
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface ISerializableThrowingBiFunction<T,​U,​R>
    extends IThrowingBiFunction<T,​U,​R>, Serializable
    A BiFunction that is also serializable and can throw exceptions.

    Represents a function that accepts two arguments and produces a result. This is the two-arity specialization of Function.

    This is a functional interface whose functional method is IThrowingBiFunction.tryApply(Object, Object).

    Since:
    8.3.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • SerializableThrowingBiFunction

        static <T,​U,​R> ISerializableThrowingBiFunction<T,​U,​R> SerializableThrowingBiFunction​(ISerializableThrowingBiFunction<T,​U,​R> fn)
        Returns the given function, for improved variable inference. Sometimes you need to create local variables and assign them to a new lambda. This does not work well with variable inference, as Java cannot infer the type of an anonymous lambda. This utility method lets you write slightly more readable code like this:
         final var fn = serializableThrowingBiFunction((t, u) -> ...);
        
         
        Type Parameters:
        T - the type of the first argument to the function
        U - the type of the second argument to the function
        R - the type of the result of the function
        Parameters:
        fn - Function to return.
        Returns:
        The given function.