Package org.immutables.func
Annotation Type Functional.BindParameters
-
@Target(METHOD) @Retention(CLASS) public static @interface Functional.BindParametersPlace on non-accessor methods of abstract value type to generate function to which parameters can be bound.@Value.Immutable @Functional public abstract class Xyz { @Value.Parameter public abstract String getX(); @Functional.BindParameters public String computeZ(String y) { return getX() + y; } } ... // Generated function public static FunctioncomputeZ(String y) { return new Function () { @Override public String apply(Xyz input) { return input.computeZ(y); } @Override public String toString() { return "XyzFunctions.computeZ(y)"; } } } ... // Use as Function fn = XyzFunctions.computeZ("Y");