org.jjoost.util
Class Functions.MethodProjection<E,F>
java.lang.Object
org.jjoost.util.Functions.MethodProjection<E,F>
- All Implemented Interfaces:
- java.io.Serializable, Function<E,F>
- Enclosing class:
- Functions
public static final class Functions.MethodProjection<E,F>
- extends java.lang.Object
- implements Function<E,F>
A Function which accepts a Method and arguments to provide to the method, which will execute the method on
each object it receives as an argument, returning the result.
- Author:
- b.elliottsmith
- See Also:
- Serialized Form
|
Constructor Summary |
Functions.MethodProjection(java.lang.Class<F> returnType,
java.lang.reflect.Method m,
java.lang.Object[] args)
Create a new MethodProjection class, which executes the provided method on any input object, using the provided arguments |
|
Method Summary |
F |
apply(E v)
Returns the result of applying the function to the parameter |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Functions.MethodProjection
public Functions.MethodProjection(java.lang.Class<F> returnType,
java.lang.reflect.Method m,
java.lang.Object[] args)
- Create a new MethodProjection class, which executes the provided method on any input object, using the provided arguments
- Parameters:
returnType - the return type of the provided method, provided for type safetym - the methodargs - the arguments to provide to each method call
apply
public F apply(E v)
- Description copied from interface:
Function
- Returns the result of applying the function to the parameter
- Specified by:
apply in interface Function<E,F>
- Parameters:
v - something of type domain
- Returns:
- the result of the function (something of type range)