com.google.common.base
Interface Function<F,T>

Type Parameters:
F - the type of the function input
T - the type of the function output

public interface Function<F,T>

A transformation from one object to another. For example, a string-to-integer function would implement Function<String, Integer> to convert integer values in text form into Integer form.

Implementations which may cause side effects upon evaluation are strongly encouraged to state this fact clearly in their API documentation.

Since:
2 (imported from Google Collections Library)
Author:
Kevin Bourrillion, Scott Bonneau

Method Summary
 T apply(F from)
          Applies the function to an object of type F, resulting in an object of type T.
 boolean equals(Object obj)
          Indicates whether some other object is equal to this Function.
 

Method Detail

apply

T apply(@Nullable
        F from)
Applies the function to an object of type F, resulting in an object of type T. Note that types F and T may or may not be the same.

Parameters:
from - the source object
Returns:
the resulting object

equals

boolean equals(@Nullable
               Object obj)
Indicates whether some other object is equal to this Function. This method can return true only if the specified object is also a Function and, for every input object o, it returns exactly the same value. Thus, function1.equals(function2) implies that either function1.apply(o) and function2.apply(o) are both null, or function1.apply(o).equals(function2.apply(o)).

Note that it is always safe not to override Object.equals(java.lang.Object).

Overrides:
equals in class Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Object.hashCode(), HashMap