public class NullFilter extends Object implements org.apache.commons.collections.Predicate, Lookup, org.apache.commons.collections.Transformer, ChainAware
AbstractEntityTransformer
will interpret the null as a BreakChainException
or return a null value back in the chain (using ContinueProcessingException
)
Transformer
then it will throw Exceptions if no defaultValue
is used, else on null the defaultValue
is returned.
TODO: Add to unit test case JSONNull conditionsConstructor and Description |
---|
NullFilter() |
Modifier and Type | Method and Description |
---|---|
boolean |
evaluate(Object object) |
Chain |
getChain()
If the processor that implements this is part of a chain, it will return a reference to the chain else null
|
Object |
getDefaultValue()
In any Transformation or Lookup, if the default value is sent then
instead of null or causing an exception, it will return the default value
|
Object |
getPredecessor()
Get the item before this one in the Chain
|
boolean |
isBlank() |
boolean |
isEmpty() |
boolean |
isThrowException()
If true the filter will reject the record by means of an Exception (not a
BreakChainException ), if being used as a Transformer then a ContinueProcessingException will be thrown if true |
void |
setBlank(boolean blank) |
void |
setChain(Chain chain)
If the processor that implements this is part of a chain, it will have a reference to the chain
|
void |
setDefaultValue(Object defaultValue)
In any Transformation or Lookup, if the default value is sent then
instead of null or causing an exception, it will return the default value
|
void |
setEmpty(boolean empty) |
void |
setPredecessor(Object predecessor)
Get the item before this one in the Chain
|
void |
setThrowException(boolean throwException)
If true the filter will reject the record by means of an Exception (not a
BreakChainException ), if being used as a Transformer then a ContinueProcessingException will be thrown if true |
Object |
transform(Object input)
For a Given String, Lookup a value for it
|
public boolean evaluate(Object object)
evaluate
in interface org.apache.commons.collections.Predicate
public boolean isEmpty()
public void setEmpty(boolean empty)
public boolean isBlank()
public void setBlank(boolean blank)
public Object transform(Object input)
Lookup
public void setChain(Chain chain)
ChainAware
setChain
in interface ChainAware
chain
- as Chain
public Chain getChain()
ChainAware
getChain
in interface ChainAware
Chain
public Object getPredecessor()
ChainAware
getPredecessor
in interface ChainAware
public void setPredecessor(Object predecessor)
ChainAware
setPredecessor
in interface ChainAware
public Object getDefaultValue()
public void setDefaultValue(Object defaultValue)
public boolean isThrowException()
BreakChainException
), if being used as a Transformer
then a ContinueProcessingException
will be thrown if truepublic void setThrowException(boolean throwException)
BreakChainException
), if being used as a Transformer
then a ContinueProcessingException
will be thrown if trueCopyright © 2018. All rights reserved.