public class Restriction extends Object
Restriction rteq = new Restriction("title", curTitle); // restrict search to title equals value of curTitleRestriction rtne = new Restriction("title", curTitle, Restriction.NOT_EQUALS); // restrict search to title not equals value of curTitle| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
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
|
| Modifier and Type | Method and Description |
|---|---|
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() |
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 int comparison
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...public String getProperty()
public void setProperty(String property)
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)
Copyright © 2007–2019 Sakai Project. All rights reserved.