|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sakaiproject.entitybroker.entityprovider.search.Restriction
public class Restriction
A simple bean which defines a restriction in a search, this is like saying:
where userId = '123'; OR where userId like '%aaronz%';
Example usage:
Restriction rteq = new Restriction("title", curTitle); // restrict search to title equals value of curTitle
Restriction rtne = new Restriction("title", curTitle, Restriction.NOT_EQUALS); // restrict search to title not equals value of curTitle
| Field Summary | |
|---|---|
int |
comparison
the comparison to make between the property and the value, use the defined constants: e.g. |
static int |
EQUALS
|
static int |
GREATER
|
static int |
LESS
|
static int |
LIKE
|
static int |
NOT_EQUALS
|
static int |
NOT_NULL
|
static int |
NULL
|
String |
property
the name of the field (property) in the search |
Object |
value
the value of the property (can be an array of items) |
| Constructor Summary | |
|---|---|
Restriction(String property,
Object value)
Simple restriction where the property must equal the value |
|
Restriction(String property,
Object value,
int comparison)
Restriction which defines the type of comparison to make between a property and value |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
Object[] |
getArrayValue()
|
boolean |
getBooleanValue()
|
int |
getComparison()
the comparison to make between the property and the value, use the defined constants: e.g. |
String |
getProperty()
the name of the field (property) in the search |
Object |
getSingleValue()
|
String |
getStringValue()
|
Object |
getValue()
the value of the property (can be an array of items) |
int |
hashCode()
|
void |
setComparison(int comparison)
|
void |
setProperty(String property)
|
void |
setValue(Object value)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int EQUALS
public static final int GREATER
public static final int LESS
public static final int LIKE
public static final int NULL
public static final int NOT_NULL
public static final int NOT_EQUALS
public String property
public Object value
property (can be an array of items)
public int comparison
| Constructor Detail |
|---|
public Restriction(String property,
Object value)
property - the name of the field (property) in the persisted objectvalue - the value of the property (can be an array of items)
public Restriction(String property,
Object value,
int comparison)
property - the name of the field (property) in the persisted objectvalue - the value of the property (can be an array of items)comparison - the comparison to make between the property and the value,
use the defined constants: e.g. EQUALS, LIKE, etc...| Method Detail |
|---|
public String getProperty()
public void setProperty(String property)
public Object getValue()
property (can be an array of items)
public void setValue(Object value)
public String getStringValue()
property,
converts arrays to strings automatically,
if null then return ''public boolean getBooleanValue()
public Object getSingleValue()
public Object[] getArrayValue()
public int getComparison()
public void setComparison(int comparison)
public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||