Interface Function<T,R>

All Superinterfaces:
Serializable
All Known Subinterfaces:
StatefulMapConcatAccumulator<In,Out>

public interface Function<T,R> extends Serializable
A Function interface. Used to create 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.Function counterpart does not.
  • Method Summary

    Modifier and Type
    Method
    Description
    <V> Function<T,V>
    Creates a composed function that first applies this function to its input, then applies g to the result.
    apply(T param)
     
    <V> Function<V,R>
    That is, the resulting function is equivalent to this(g(v)).
  • Method Details

    • apply

      R apply(T param) throws Exception
      Throws:
      Exception
    • compose

      <V> Function<V,R> compose(Function<V,T> g)
      That is, the resulting function is equivalent to this(g(v)).
      Since:
      2.0.0
    • andThen

      <V> Function<T,V> andThen(Function<R,V> g)
      Creates a composed function that first applies this function to its input, then applies g to the result.
      Since:
      2.0.0