public final class HasPrefix extends SimpleQueryExpression
HasPrefix class represents a dynamic query expression that
checks whether the value of a profile attribute is prefixed by a specified value.
This query expression can only be used with profile attributes of type
java.lang.String.
| Constructor and Description |
|---|
HasPrefix(String attrName,
String attrValue)
Create a
HasPrefix query expression. |
HasPrefix(String attrName,
String attrValue,
QueryCollator collator)
Create a
HasPrefix 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, toStringtoStringpublic HasPrefix(String attrName, String attrValue)
HasPrefix query expression. A profile will match
the expression criteria if the value specified by attrValue
argument is a prefix of the value of the attrName profile
attribute, as determined by String.startsWith(String).attrName - the name of the profile attribute to compare.attrValue - the value of the attribute to compare with.NullPointerException - if either argument is null.public HasPrefix(String attrName, String attrValue, QueryCollator collator)
HasPrefix query expression. A profile will match
the expression criteria if the value specified by attrValue
argument is a prefix of the value of the attrName profile
attribute, as determined by Collator.equals(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()
SimpleQueryExpressiontoString output.getRelation in class SimpleQueryExpression