public class Filter
extends java.lang.Object
implements java.io.Serializable
Filter can be used to restrict the result list returned by
ModelExplorer.getEntities(de.aristaflow.adept2.base.sessionmanagement.SessionToken, de.aristaflow.adept2.model.orgmodel.EntityType, Filter, boolean, String...).
An entity has to match all selections / restrictions or just one in order to
pass the filter.| Modifier and Type | Class and Description |
|---|---|
static class |
Filter.Selection
A simple container class for a selection/condition, consisting of an
attribute name, a comparison operator and a value object.
|
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
disjunction
Whether this filter is a disjunction (only one selection/restriction has to
apply).
|
| Constructor and Description |
|---|
Filter()
Creates a new conjunction filter.
|
Filter(boolean conjunction)
Creates a new filter either a conjunction or a disjunction.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSelection(java.lang.String attrName,
CmpOperator cmpOperator,
java.io.Serializable value)
Adds a new selection to the
Filter. |
void |
clear()
Clears all selections from this filter so that it's empty again.
|
Filter.Selection |
getSelectionAt(int index)
Returns the selection at the given index.
|
int |
getSelectionCount()
Returns the number of selections in this filter.
|
Filter.Selection[] |
getSelections()
Returns all selections of this filter.
|
boolean |
isConjunction()
Gets whether this filter is a conjunction (all selections/restrictions have
to apply).
|
protected final boolean disjunction
false is also
the historical default (conjunction) for a filter.public Filter()
public Filter(boolean conjunction)
conjunction - Whether this filter is a conjunction (all
selections/restrictions have to apply).public boolean isConjunction()
public int getSelectionCount()
public Filter.Selection getSelectionAt(int index)
index - the index of the selection to be returnedpublic Filter.Selection[] getSelections()
public void addSelection(java.lang.String attrName,
CmpOperator cmpOperator,
java.io.Serializable value)
Filter. Please note that at
this point there will be no check whether the attribute really exists, the
value has the correct type or the operator can actually be applied to the
type of the attribute/value. It will be checked however, if the value
object is one of the defined DataTypes. An
IllegalArgumentException will be thrown, if it isn't.attrName - The attribute on which the restriction is applied.cmpOperator - The operator to be used to compare the values.value - The value of the restriction that is used to compare the
actual values to.java.lang.IllegalArgumentException - If the value object is not one of the
defined DataTypes or attrName is not a valid
attribute name.public void clear()