T - the returned value type.public final class Identity<T> extends Object implements UnaryFunction<T,T>, UnaryPredicate<T>, Serializable
Evaluates to its input argument.
Tests to the boolean
value of the Boolean-valued parameter.
The test(java.lang.Object) method throws an exception if
the parameter isn't a non-null
Boolean.| Modifier and Type | Field and Description |
|---|---|
static Identity<Object> |
INSTANCE
A generic
Identity<Object> instance. |
| Constructor and Description |
|---|
Identity()
Create a new Identity.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object that) |
T |
evaluate(T obj)
Evaluate this function.
|
int |
hashCode() |
static <T> Identity<T> |
instance()
Get an Identity instance.
|
boolean |
test(Boolean bool)
Test a Boolean object by returning its
booleanValue. |
boolean |
test(Object obj)
Evaluate this predicate.
|
String |
toString() |
public Identity()
public T evaluate(T obj)
evaluate in interface UnaryFunction<T,T>obj - the A object to evaluatepublic boolean test(Object obj)
test in interface UnaryPredicate<T>obj - the A object to testpublic boolean test(Boolean bool)
booleanValue.bool - BooleanCopyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.