public class SearchCriteria
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
SearchCriteria.Argument |
static class |
SearchCriteria.Operator
Operators that are available for constructing the search criteria
|
Constructor and Description |
---|
SearchCriteria(java.lang.Object arg1,
java.lang.Object arg2,
SearchCriteria.Operator operator)
Construct a search criteria
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getFirstArgument()
Returns the first argument value in the criteria.
|
SearchCriteria.Operator |
getOperator()
Returns the operator used in the search criteria
|
java.lang.Object |
getSecondArgument()
Returns the second argument value in the criteria.
|
java.lang.String |
toString() |
public SearchCriteria(java.lang.Object arg1, java.lang.Object arg2, SearchCriteria.Operator operator)
arg1
- a string object containing the name of the attribute to search on or an object of type SearchCriteriaarg2
- a string object containing the value of the attribute to search with or an object of type SearchCriteriaoperator
- One of the values from Operator enum
Below is the code snippet that shows how to construct SearchCriteria where you want to search for 3 users by their login. Lets assume their login values are user1, user2 and user3
SearchCriteria criteria, criteria1, criteria2, criteria3;
criteria1 = new SearchCriteria("User Login", "user1",
SearchCriteria.Operator.EQUAL);
criteria2 = new SearchCriteria("User Login", "user2",
SearchCriteria.Operator.EQUAL);
criteria3 = new SearchCriteria("User Login", "user3",
SearchCriteria.Operator.EQUAL);
criteria = new SearchCriteria(criteria1, criteria2, Operator.OR);
criteria = new SearchCriteria(criteria, criteria3, Operator.OR);
...public SearchCriteria.Operator getOperator()
public java.lang.Object getFirstArgument()
public java.lang.Object getSecondArgument()
public java.lang.String toString()
toString
in class java.lang.Object