Interface Function2<T1,T2,R>

All Superinterfaces:
Serializable

public interface Function2<T1,T2,R> extends Serializable
A Function interface. Used to create 2-arg first-class-functions is Java. Serializable is needed to be able to grab line number for Java 8 lambdas. Supports throwing Exception in the apply, which the java.util.function.BiFunction counterpart does not.
  • Method Summary

    Modifier and Type
    Method
    Description
    <V> Function2<T1,T2,V>
    Compose this function with another function g, such that the resulting function is equivalent to g(this(x1, x2)).
    apply(T1 arg1, T2 arg2)
     
  • Method Details

    • andThen

      <V> Function2<T1,T2,V> andThen(Function<R,V> g)
      Compose this function with another function g, such that the resulting function is equivalent to g(this(x1, x2)). This creates a composed function that first applies this function to its arguments, and then applies function g to the result.
      Since:
      2.0.0
    • apply

      R apply(T1 arg1, T2 arg2) throws Exception
      Throws:
      Exception