@ThingworxExtensionApiClass(since={6,6}, canInstantiate=true) public final class LikeFilter extends java.lang.Object implements IFilter
Constructor and Description |
---|
LikeFilter(java.lang.String fieldName,
java.lang.String expression,
boolean isSQLPattern,
boolean inclusive,
boolean caseSensitive)
|
Modifier and Type | Method and Description |
---|---|
boolean |
evaluateFilter(ValueCollection row) |
boolean |
evaluateValue(IPrimitiveType iPrimitive) |
java.lang.String |
getFieldName() |
java.lang.String |
getFilterExpression()
Gets the filter expression. |
boolean |
isCaseSensitive() |
boolean |
isInclusive() |
boolean |
isSQLPattern() |
void |
resolveFields(DataShapeDefinition metadata) |
void |
setFieldName(java.lang.String value) |
void |
setFilterExpression(java.lang.String expression)
Sets the filter expression. |
org.json.JSONObject |
toJSON()
Produces JSON representation of this filter. |
@ThingworxExtensionApiMethod(since={6,6}) public LikeFilter(java.lang.String fieldName, java.lang.String expression, boolean isSQLPattern, boolean inclusive, boolean caseSensitive)
LikeFilter
instance.
Note that the filtering behavior when using a wildcard expression (as opposed to regular expressions) is SQL-like, but not quite equivalent to SQL's wildcard expressions. Wildcard expressions here support '*' (or '%') as multi-character wildcards and '?' as a single character wildcard, but do not support '_' as a wildcard.
fieldName
- Name of field to filterexpression
- Wildcard or regular expression to match againstisSQLPattern
- When true, the expression is treated as a wildcard expression; else it is treated as a regular expressioninclusive
- True implies a "like" condition; false implies a "not like" conditioncaseSensitive
- Whether the matching should be case-sensitive@ThingworxExtensionApiMethod(since={6,6}) public void resolveFields(DataShapeDefinition metadata)
resolveFields
in interface IFilter
@ThingworxExtensionApiMethod(since={6,6}) public java.lang.String getFieldName()
getFieldName
in interface IFilter
@ThingworxExtensionApiMethod(since={6,6}) public void setFieldName(java.lang.String value)
setFieldName
in interface IFilter
@ThingworxExtensionApiMethod(since={6,6}) public void setFilterExpression(java.lang.String expression)
IFilter
setFilterExpression
in interface IFilter
expression
- the filter expressionIFilter.getFilterExpression()
@ThingworxExtensionApiMethod(since={6,6}) public java.lang.String getFilterExpression()
IFilter
getFilterExpression
in interface IFilter
IFilter.setFilterExpression(String)
@ThingworxExtensionApiMethod(since={6,6}) public boolean isInclusive()
@ThingworxExtensionApiMethod(since={6,6}) public boolean isSQLPattern()
@ThingworxExtensionApiMethod(since={6,6}) public boolean isCaseSensitive()
@ThingworxExtensionApiMethod(since={6,6}) public boolean evaluateValue(IPrimitiveType iPrimitive)
evaluateValue
in interface IFilter
@ThingworxExtensionApiMethod(since={6,6}) public boolean evaluateFilter(ValueCollection row)
evaluateFilter
in interface IFilter
@ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONObject toJSON() throws org.json.JSONException
CommonPropertyNames.PROP_TYPE
: FilterFactory.FILTER_LIKE
,
FilterFactory.FILTER_NOT_LIKE
, FilterFactory.FILTER_MATCHES
, or FilterFactory.FILTER_NOT_MATCHES
as
appropriate, based on whether the filter's isInclusive()
and isSQLPattern()
state.
CommonPropertyNames.PROP_FIELDNAME
: getFieldName()
result
CommonPropertyNames.PROP_VALUE
: when isSQLPattern()
is true (only),
getFilterExpression()
result
CommonPropertyNames.PROP_EXPRESSION
: when isSQLPattern()
is false (only),
getFilterExpression()
result
CommonPropertyNames.PROP_ISCASESENSITIVE
: isCaseSensitive()
result, when true