public class ConditionalTransform extends java.lang.Object implements java.io.Serializable, ObjectTransform
| Constructor and Description |
|---|
ConditionalTransform()
Create a new ConditionalTransform.
|
| Modifier and Type | Method and Description |
|---|---|
ObjectTransform |
getElseTransform()
Optional transform to run if ifCondition evaluates to false.
|
UnaryPredicate |
getIfCondition()
Condition which, if it evaluates to true, runs the thenTransform,
otherwise runs the elseTransform if it exists.
|
ObjectTransform |
getThenTransform()
Transform run if ifCondition evaluates to true.
|
void |
setElseTransform(ObjectTransform newElseTransform)
Transform run if ifCondition evaluates to false.
|
void |
setIfCondition(UnaryPredicate newIfCondition)
Condition which, if it evaluates to true, runs the thenTransform,
otherwise runs the elseTransform if it exists.
|
void |
setThenTransform(ObjectTransform newThenTransform)
Transform run if ifCondition evaluates to true.
|
java.lang.Object |
transform(java.lang.Object victim)
Our one method; this transforms one object into another.
|
public ConditionalTransform()
public java.lang.Object transform(java.lang.Object victim)
ObjectTransformtransform in interface ObjectTransformpublic ObjectTransform getElseTransform()
public void setElseTransform(ObjectTransform newElseTransform)
public UnaryPredicate getIfCondition()
public void setIfCondition(UnaryPredicate newIfCondition)
public ObjectTransform getThenTransform()
public void setThenTransform(ObjectTransform newThenTransform)