T - the returned value type.public final class ConditionalFunction<T> extends Object implements Function<T>, Serializable
Function
similiar to Java's "ternary"
or "conditional" operator (? :).
Given a predicate
p and functions
f and g, evaluates
to
p.test() ? f.evaluate() : g.evaluate().
Note that although this class implements
Serializable, a given instance will
only be truly Serializable if all the
underlying functors are. Attempts to serialize
an instance whose delegates are not all
Serializable will result in an exception.
| Constructor and Description |
|---|
ConditionalFunction(Predicate ifPred,
Function<? extends T> thenFunc,
Function<? extends T> elseFunc)
Create a new ConditionalFunction.
|
public boolean equals(ConditionalFunction<?> that)
that - ConditionalFunction to testCopyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.