org.jjoost.util
Class Functions.FieldProjection<E,F>

java.lang.Object
  extended by org.jjoost.util.Functions.FieldProjection<E,F>
All Implemented Interfaces:
java.io.Serializable, Function<E,F>
Enclosing class:
Functions

public static final class Functions.FieldProjection<E,F>
extends java.lang.Object
implements Function<E,F>

A Function which accepts a Field (reflection API), which will be retrieved and returned from every object the function is applied to.

Author:
b.elliottsmith
See Also:
Serialized Form

Constructor Summary
Functions.FieldProjection(java.lang.Class<F> returnType, java.lang.reflect.Field f)
          Create a new FieldProjection
 
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
 

Constructor Detail

Functions.FieldProjection

public Functions.FieldProjection(java.lang.Class<F> returnType,
                                 java.lang.reflect.Field f)
Create a new FieldProjection

Parameters:
returnType - the type stored by the field
f - the Field object
Method Detail

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)