public final class GreaterThan extends OrderedQueryExpression
GreaterThan
class represents a dynamic query expression that
checks whether the value of a profile attribute is greater than a specified value.
This query expression can only be used with profile attributes whose class
implements the Comparable
interface.
Constructor and Description |
---|
GreaterThan(String attrName,
Object attrValue)
Create a
GreaterThan query expression. |
GreaterThan(String attrName,
String attrValue,
QueryCollator collator)
Create a
GreaterThan query expression. |
Modifier and Type | Method and Description |
---|---|
protected String |
getRelation()
Get the symbol or other name for this expression relation to be used in the
toString output. |
getAttributeName, getAttributeValue, getCollator, toString
toString
public GreaterThan(String attrName, Object attrValue) throws NullPointerException
GreaterThan
query expression. A profile will match
the expression criteria if the value of the attrName
attribute
is greater than attrValue
, as determined by Comparable.compareTo(Object)
attrName
- the name of the profile attribute to compare.attrValue
- the value of the attribute to compare with.NullPointerException
- if either argument is null
.IllegalArgumentException
- if the class of attrValue
does
not implement the java.lang.Comparable
interface.public GreaterThan(String attrName, String attrValue, QueryCollator collator) throws NullPointerException
GreaterThan
query expression. A profile will match the
expression criteria if the value of the attrName
attribute
is greater than attrValue
, as determined by Collator.compare(String, String)
,
where the collator is obtained from the specified QueryCollator
.attrName
- the name of the profile attribute to compare.attrValue
- the value of the attribute to compare with.collator
- the collator to use for the comparison. May be null
.NullPointerException
- if either attrName
or
attrValue
is null
.protected String getRelation()
SimpleQueryExpression
toString
output.getRelation
in class SimpleQueryExpression