T
- as event/change type
TODO: Add Unit test casepublic class ChangeListenerWrapperTransformer<T> extends Object implements ChangeListenerTransfomer<T>
ChangeListener
that can wrap any Transformer
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.collections.Predicate |
predicate
An optional
Predicate that can filter events before they reach the transformer .If null then no filteration will apply. |
protected org.apache.commons.collections.Transformer |
transformer
On
predicate ed event, call this for action |
Constructor and Description |
---|
ChangeListenerWrapperTransformer() |
ChangeListenerWrapperTransformer(org.apache.commons.collections.Transformer t) |
Modifier and Type | Method and Description |
---|---|
org.apache.commons.collections.Predicate |
getPredicate()
An optional
Predicate that can filter events before they reach the transformer .If null then no filteration will apply. |
org.apache.commons.collections.Transformer |
getTransformer()
On
predicate ed event, call this for action |
void |
onChange(ChangeGenerator<T> changeGenerator,
T modelObject) |
void |
setPredicate(org.apache.commons.collections.Predicate predicate)
An optional
Predicate that can filter events before they reach the transformer .If null then no filteration will apply. |
void |
setTransformer(org.apache.commons.collections.Transformer transformer)
On
predicate ed event, call this for action |
Object |
transform(Object input) |
protected org.apache.commons.collections.Transformer transformer
predicate
ed event, call this for actionprotected org.apache.commons.collections.Predicate predicate
Predicate
that can filter events before they reach the transformer
.Predicate.evaluate(Object)
= false then the event will be filtered hence will NOT reach the transformer
Transformer
.public ChangeListenerWrapperTransformer()
public ChangeListenerWrapperTransformer(org.apache.commons.collections.Transformer t)
public void onChange(ChangeGenerator<T> changeGenerator, T modelObject)
onChange
in interface ChangeListener<T>
changeGenerator
- as the generator that caused the change. Specially useful if the Listener is subscribing to multiple ChangeGenerator
smodelObject
- as the model change communicatedpublic Object transform(Object input)
transform
in interface org.apache.commons.collections.Transformer
public org.apache.commons.collections.Transformer getTransformer()
predicate
ed event, call this for actionpublic void setTransformer(org.apache.commons.collections.Transformer transformer)
predicate
ed event, call this for actionpublic org.apache.commons.collections.Predicate getPredicate()
Predicate
that can filter events before they reach the transformer
.Predicate.evaluate(Object)
= false then the event will be filtered hence will NOT reach the transformer
Transformer
.public void setPredicate(org.apache.commons.collections.Predicate predicate)
Predicate
that can filter events before they reach the transformer
.Predicate.evaluate(Object)
= false then the event will be filtered hence will NOT reach the transformer
Transformer
.Copyright © 2018. All rights reserved.