F
- the type of the function inputT
- the type of the function outputpublic interface Function<F,T>
StringToIntegerFunction
may implement
Function<String,Integer>
and transform integers in
String
format to Integer
format.
The transformation on the source object does not necessarily result in
an object of a different type. For example, a
FarenheitToCelsiusFunction
may implement
Function<Float,Float>
.
Implementations which may cause side effects upon evaluation are strongly encouraged to state this fact clearly in their API documentation.
This interface may be used with the Google Web Toolkit (GWT).
T apply(@Nullable F from)
F
, resulting in an object
of type T
. Note that types F
and T
may or may not
be the same.from
- the source objectboolean equals(@Nullable Object obj)
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)
.
Copyright © 2006-2012 Google, Inc.. All Rights Reserved.