net.sf.doolin.util
Class MethodFunction<S,T>

java.lang.Object
  extended by net.sf.doolin.util.MethodFunction<S,T>
Type Parameters:
S - Type of the source object
T - Type of the target object
All Implemented Interfaces:
com.google.common.base.Function<S,T>

public class MethodFunction<S,T>
extends Object
implements com.google.common.base.Function<S,T>

Converts a S object into a T object by calling a method on S.

Author:
Damien Coraboeuf

Constructor Summary
MethodFunction(String methodName)
          Constructor
 
Method Summary
 T apply(S source)
          Calls the method on the source object and casts the result to <T>.
 String getMethodName()
          Returns the method name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.common.base.Function
equals
 

Constructor Detail

MethodFunction

public MethodFunction(String methodName)
Constructor

Parameters:
methodName - Method name
Method Detail

apply

public T apply(S source)
Calls the method on the source object and casts the result to <T>.

Specified by:
apply in interface com.google.common.base.Function<S,T>

getMethodName

public String getMethodName()
Returns the method name

Returns:
Method name


Copyright © 2011. All Rights Reserved.