public class BasicFilter<T extends HasId> extends java.lang.Object implements IMutableFilter<T>
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.Boolean> |
acceptMap
Accept map
|
protected boolean |
acceptNull
Null is false
|
Constructor and Description |
---|
BasicFilter(boolean acceptNullFlag)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(HasId hasId)
Checks if the given object passes the filter.
|
boolean |
accept(java.lang.String id)
Checks if the given object passes the filter.
|
<E extends HasId> |
filter(java.util.Collection<E> list0)
Filter list of objects having id
|
java.util.Collection<java.lang.String> |
keys()
Get keys
|
void |
setAccept(java.lang.String id,
boolean flag)
Set acceptance value for object.
|
protected final boolean acceptNull
protected java.util.Map<java.lang.String,java.lang.Boolean> acceptMap
public BasicFilter(boolean acceptNullFlag)
acceptNullFlag
- whether null flag means acceptpublic boolean accept(HasId hasId)
IFilter
public boolean accept(java.lang.String id)
IFilter
public java.util.Collection<java.lang.String> keys()
IFilter
public void setAccept(java.lang.String id, boolean flag)
IMutableFilter
setAccept
in interface IMutableFilter<T extends HasId>
id
- object id to testflag
- valuepublic <E extends HasId> java.util.List<E> filter(java.util.Collection<E> list0)
E
- element typelist0
- source list of objects