Interface ValueFunction<T>

All Superinterfaces:
Function<Escaper,T>
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 ValueFunction<T> extends Function<Escaper,T>
Represents a value function to return arbitrary values that can be escaped before returning the actual value. Can be used with the criteria API for deferred value retrieval.
Since:
2.0
Author:
Mark Paluch
See Also:
  • Method Details

    • apply

      @Nullable T apply(Escaper escaper)
      Produces a value by considering the given Escaper.
      Specified by:
      apply in interface Function<Escaper,T>
      Parameters:
      escaper - the escaper to use.
      Returns:
      the return value, may be null.
    • toSupplier

      default Supplier<T> toSupplier(Escaper escaper)
      Adapts this value factory into a Supplier by using the given Escaper.
      Parameters:
      escaper - the escaper to use.
      Returns:
      the value factory
    • map

      default <R> ValueFunction<R> map(Function<T,R> mapper)
      Return a new ValueFunction applying the given mapping Function. The mapping function is applied after applying Escaper.
      Type Parameters:
      R - the type of the value returned from the mapping function.
      Parameters:
      mapper - the mapping function to apply to the value.
      Returns:
      a new ValueFunction.
      Since:
      3.2