|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.trg.search.Filter
public class Filter
A Filter is used by the Search class to specify a
restriction on what results should be returned in the search. For example, if
a filter Filter.equal("name","Paul") were added to the search,
only objects with the property "name" equal to the string "Paul" would be
returned.
Nested properties can also be specified, for example
Filter.greaterThan("employee.age",65).
| Field Summary | |
|---|---|
static int |
OP_ALL
|
static int |
OP_AND
|
static int |
OP_EMPTY
|
static int |
OP_EQUAL
|
static int |
OP_GREATER_OR_EQUAL
|
static int |
OP_GREATER_THAN
|
static int |
OP_IEQUAL
|
static int |
OP_ILIKE
|
static int |
OP_IN
|
static int |
OP_LESS_OR_EQUAL
|
static int |
OP_LESS_THAN
|
static int |
OP_LIKE
|
static int |
OP_NONE
|
static int |
OP_NOT
|
static int |
OP_NOT_EMPTY
|
static int |
OP_NOT_EQUAL
|
static int |
OP_NOT_IN
|
static int |
OP_NOT_NULL
|
static int |
OP_NULL
|
static int |
OP_OR
|
static int |
OP_SOME
|
protected int |
operator
The type of comparison to do between the property and the value. |
protected java.lang.String |
property
The name of the property to filter on. |
static java.lang.String |
ROOT_ENTITY
Property string representing the root entity of the search. |
protected java.lang.Object |
value
The value to compare the property with. |
| Constructor Summary | |
|---|---|
Filter()
|
|
Filter(java.lang.String property,
java.lang.Object value)
|
|
Filter(java.lang.String property,
java.lang.Object value,
int operator)
|
|
| Method Summary | |
|---|---|
void |
add(Filter filter)
Used with OP_OR and OP_AND filters. |
static Filter |
all(java.lang.String property,
Filter filter)
Create a new Filter using the ALL operator. |
static Filter |
and(Filter... filters)
Create a new Filter using the AND operator. |
static Filter |
equal(java.lang.String property,
java.lang.Object value)
Create a new Filter using the == operator. |
boolean |
equals(java.lang.Object obj)
|
int |
getOperator()
|
java.lang.String |
getProperty()
|
java.lang.Object |
getValue()
|
static Filter |
greaterOrEqual(java.lang.String property,
java.lang.Object value)
Create a new Filter using the >= operator. |
static Filter |
greaterThan(java.lang.String property,
java.lang.Object value)
Create a new Filter using the > operator. |
int |
hashCode()
|
static Filter |
iequal(java.lang.String property,
java.lang.Object value)
Create a new Filter using the == operator. |
static Filter |
ilike(java.lang.String property,
java.lang.String value)
Create a new Filter using the ILIKE operator. |
static Filter |
in(java.lang.String property,
java.util.Collection<?> value)
Create a new Filter using the IN operator. |
static Filter |
in(java.lang.String property,
java.lang.Object... value)
Create a new Filter using the IN operator. |
static Filter |
isEmpty(java.lang.String property)
Create a new Filter using the IS EMPTY operator. |
static Filter |
isNotEmpty(java.lang.String property)
Create a new Filter using the IS NOT EMPTY operator. |
static Filter |
isNotNull(java.lang.String property)
Create a new Filter using the IS NOT NULL operator. |
static Filter |
isNull(java.lang.String property)
Create a new Filter using the IS NULL operator. |
boolean |
isTakesListOfSubFilters()
|
boolean |
isTakesListOfValues()
|
boolean |
isTakesNoProperty()
|
boolean |
isTakesNoValue()
|
boolean |
isTakesSingleSubFilter()
|
boolean |
isTakesSingleValue()
|
static Filter |
lessOrEqual(java.lang.String property,
java.lang.Object value)
Create a new Filter using the <= operator. |
static Filter |
lessThan(java.lang.String property,
java.lang.Object value)
Create a new Filter using the < operator. |
static Filter |
like(java.lang.String property,
java.lang.String value)
Create a new Filter using the LIKE operator. |
static Filter |
none(java.lang.String property,
Filter filter)
Create a new Filter using the NONE operator. |
static Filter |
not(Filter filter)
Create a new Filter using the NOT operator. |
static Filter |
notEqual(java.lang.String property,
java.lang.Object value)
Create a new Filter using the ! |
static Filter |
notIn(java.lang.String property,
java.util.Collection<?> value)
Create a new Filter using the NOT IN operator. |
static Filter |
notIn(java.lang.String property,
java.lang.Object... value)
Create a new Filter using the NOT IN operator. |
static Filter |
or(Filter... filters)
Create a new Filter using the OR operator. |
void |
remove(Filter filter)
Used with OP_OR and OP_AND filters. |
void |
setOperator(int operator)
|
void |
setProperty(java.lang.String property)
|
void |
setValue(java.lang.Object value)
|
static Filter |
some(java.lang.String property,
Filter filter)
Create a new Filter using the SOME operator. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ROOT_ENTITY
protected java.lang.String property
"name", "dateOfBirth", "employee.age", "employee.spouse.job.title"
protected java.lang.Object value
"Fred", new Date(), 45
protected int operator
OP_EQAUL, OP_NOT_EQUAL, OP_LESS_THAN, OP_GREATER_THAN, LESS_OR_EQUAL, OP_GREATER_OR_EQUAL, OP_IN, OP_NOT_IN, OP_LIKE, OP_ILIKE, OP_NULL, OP_NOT_NULL, OP_EMPTY, OP_NOT_EMPTY, OP_SOME, OP_ALL, OP_NONE, OP_AND, OP_OR, OP_NOT
.
public static final int OP_EQUAL
public static final int OP_NOT_EQUAL
public static final int OP_LESS_THAN
public static final int OP_GREATER_THAN
public static final int OP_LESS_OR_EQUAL
public static final int OP_GREATER_OR_EQUAL
public static final int OP_LIKE
public static final int OP_ILIKE
public static final int OP_IN
public static final int OP_NOT_IN
public static final int OP_NULL
public static final int OP_NOT_NULL
public static final int OP_EMPTY
public static final int OP_NOT_EMPTY
public static final int OP_AND
public static final int OP_OR
public static final int OP_NOT
public static final int OP_SOME
public static final int OP_ALL
public static final int OP_NONE
public static final int OP_IEQUAL
| Constructor Detail |
|---|
public Filter()
public Filter(java.lang.String property,
java.lang.Object value,
int operator)
public Filter(java.lang.String property,
java.lang.Object value)
| Method Detail |
|---|
public static Filter iequal(java.lang.String property,
java.lang.Object value)
public static Filter equal(java.lang.String property,
java.lang.Object value)
public static Filter lessThan(java.lang.String property,
java.lang.Object value)
public static Filter greaterThan(java.lang.String property,
java.lang.Object value)
public static Filter lessOrEqual(java.lang.String property,
java.lang.Object value)
public static Filter greaterOrEqual(java.lang.String property,
java.lang.Object value)
public static Filter in(java.lang.String property,
java.util.Collection<?> value)
This takes a variable number of parameters. Any number of values can be specified.
public static Filter in(java.lang.String property,
java.lang.Object... value)
This takes a variable number of parameters. Any number of values can be specified.
public static Filter notIn(java.lang.String property,
java.util.Collection<?> value)
This takes a variable number of parameters. Any number of values can be specified.
public static Filter notIn(java.lang.String property,
java.lang.Object... value)
This takes a variable number of parameters. Any number of values can be specified.
public static Filter like(java.lang.String property,
java.lang.String value)
public static Filter ilike(java.lang.String property,
java.lang.String value)
public static Filter notEqual(java.lang.String property,
java.lang.Object value)
public static Filter isNull(java.lang.String property)
public static Filter isNotNull(java.lang.String property)
public static Filter isEmpty(java.lang.String property)
public static Filter isNotEmpty(java.lang.String property)
public static Filter and(Filter... filters)
This takes a variable number of parameters. Any number of
Filters can be specified.
public static Filter or(Filter... filters)
This takes a variable number of parameters. Any number of
Filters can be specified.
public static Filter not(Filter filter)
public static Filter some(java.lang.String property,
Filter filter)
public static Filter all(java.lang.String property,
Filter filter)
public static Filter none(java.lang.String property,
Filter filter)
public void add(Filter filter)
public void remove(Filter filter)
public java.lang.String getProperty()
public void setProperty(java.lang.String property)
public java.lang.Object getValue()
public void setValue(java.lang.Object value)
public int getOperator()
public void setOperator(int operator)
public boolean isTakesSingleValue()
EQUAL, NOT_EQUAL, LESS_THAN, LESS_OR_EQUAL, GREATER_THAN, GREATER_OR_EQUAL, LIKE, ILIKE
public boolean isTakesListOfValues()
IN, NOT_IN
public boolean isTakesNoValue()
NULL, NOT_NULL, EMPTY, NOT_EMPTY
public boolean isTakesSingleSubFilter()
NOT, ALL, SOME, NONE
public boolean isTakesListOfSubFilters()
AND, OR
public boolean isTakesNoProperty()
AND, OR, NOT
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||