Package com.thingworx.types.data.filters
Class RangeFilter
- java.lang.Object
-
- com.thingworx.types.data.filters.RangeFilter
-
- All Implemented Interfaces:
IFilter
@ThingworxExtensionApiClass(since={6,6}, canInstantiate=true) public final class RangeFilter extends java.lang.Object implements IFilter
Filter which applies a <, <=, =, >=, > or not = criteria.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RangeFilter.Type
-
Field Summary
Fields Modifier and Type Field Description static int
EQUALS
Deprecated.static int
GREATERTHAN
Deprecated.static int
GREATERTHANOREQUALS
Deprecated.static int
LESSTHAN
Deprecated.static int
LESSTHANOREQUALS
Deprecated.static int
NOTEQUALS
Deprecated.
-
Constructor Summary
Constructors Constructor Description RangeFilter(java.lang.String fieldName, int matchType, java.lang.Object value)
Deprecated.As of release 7.1, replaced byRangeFilter(String, RangeFilter.Type, Object)
RangeFilter(java.lang.String fieldName, RangeFilter.Type matchType, java.lang.Object value)
Create case-insensitive range filter.RangeFilter(java.lang.String fieldName, RangeFilter.Type matchType, java.lang.Object value, boolean caseSensitive)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
evaluateFilter(ValueCollection row)
boolean
evaluateValue(IPrimitiveType iPrimitive)
java.lang.String
getFieldName()
java.lang.String
getFilterExpression()
Deprecated.int
getMatchType()
Deprecated.As of release 7.1, replaced bygetMatchTypeEnum()
RangeFilter.Type
getMatchTypeEnum()
java.lang.Object
getMatchValue()
boolean
isCaseSensitive()
void
resolveFields(DataShapeDefinition metadata)
Converts match value to field type indicated by the provided DataShapeDefinition, if one is so indicated, except in cases where this conversion is not possible or results in a clear loss of numeric precision.void
setFieldName(java.lang.String value)
void
setFilterExpression(java.lang.String expression)
Deprecated.void
setMatchValue(java.lang.Object value)
org.json.JSONObject
toJSON()
Produces JSON representation of this filter.
-
-
-
Field Detail
-
LESSTHANOREQUALS
@Deprecated public static final int LESSTHANOREQUALS
Deprecated.- See Also:
- Constant Field Values
-
LESSTHAN
@Deprecated public static final int LESSTHAN
Deprecated.- See Also:
- Constant Field Values
-
EQUALS
@Deprecated public static final int EQUALS
Deprecated.- See Also:
- Constant Field Values
-
GREATERTHAN
@Deprecated public static final int GREATERTHAN
Deprecated.- See Also:
- Constant Field Values
-
GREATERTHANOREQUALS
@Deprecated public static final int GREATERTHANOREQUALS
Deprecated.- See Also:
- Constant Field Values
-
NOTEQUALS
@Deprecated public static final int NOTEQUALS
Deprecated.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RangeFilter
@Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={7,1}) public RangeFilter(java.lang.String fieldName, int matchType, java.lang.Object value)
Deprecated.As of release 7.1, replaced byRangeFilter(String, RangeFilter.Type, Object)
Create case-insensitive range filter.
-
RangeFilter
@ThingworxExtensionApiMethod(since={6,6}) public RangeFilter(java.lang.String fieldName, RangeFilter.Type matchType, java.lang.Object value)
Create case-insensitive range filter.
-
RangeFilter
@ThingworxExtensionApiMethod(since={6,6}) public RangeFilter(java.lang.String fieldName, RangeFilter.Type matchType, java.lang.Object value, boolean caseSensitive)
-
-
Method Detail
-
setMatchValue
@ThingworxExtensionApiMethod(since={6,6}) public void setMatchValue(java.lang.Object value)
-
getFieldName
@ThingworxExtensionApiMethod(since={6,6}) public java.lang.String getFieldName()
- Specified by:
getFieldName
in interfaceIFilter
-
getMatchType
@Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={7,1}) public int getMatchType()
Deprecated.As of release 7.1, replaced bygetMatchTypeEnum()
Returns match type as an int.- Returns:
- match type as int
-
getMatchTypeEnum
@ThingworxExtensionApiMethod(since={6,6}) public RangeFilter.Type getMatchTypeEnum()
-
getMatchValue
@ThingworxExtensionApiMethod(since={6,6}) public java.lang.Object getMatchValue()
-
setFieldName
@ThingworxExtensionApiMethod(since={6,6}) public void setFieldName(java.lang.String value)
- Specified by:
setFieldName
in interfaceIFilter
-
isCaseSensitive
@ThingworxExtensionApiMethod(since={6,6}) public boolean isCaseSensitive()
-
setFilterExpression
@Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={7,1}) public void setFilterExpression(java.lang.String expression)
Deprecated.Description copied from interface:IFilter
Sets the filter expression.- Specified by:
setFilterExpression
in interfaceIFilter
- Parameters:
expression
- the filter expression- See Also:
IFilter.getFilterExpression()
-
getFilterExpression
@Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={7,1}) public java.lang.String getFilterExpression()
Deprecated.Description copied from interface:IFilter
Gets the filter expression.- Specified by:
getFilterExpression
in interfaceIFilter
- Returns:
- the filter expression
- See Also:
IFilter.setFilterExpression(String)
-
resolveFields
@ThingworxExtensionApiMethod(since={6,6}) public void resolveFields(DataShapeDefinition metadata)
Converts match value to field type indicated by the provided DataShapeDefinition, if one is so indicated, except in cases where this conversion is not possible or results in a clear loss of numeric precision.This does not necessarily need to be called, as
evaluateValue(IPrimitiveType)
will do conversions as needed, but doing it once here ahead of multiple filtering calls generally results in somewhat faster filtering.- Specified by:
resolveFields
in interfaceIFilter
- Parameters:
metadata
- Data shape definition that may provide target field type; may be null
-
evaluateValue
@ThingworxExtensionApiMethod(since={6,6}) public boolean evaluateValue(IPrimitiveType iPrimitive)
- Specified by:
evaluateValue
in interfaceIFilter
-
evaluateFilter
@ThingworxExtensionApiMethod(since={6,6}) public boolean evaluateFilter(ValueCollection row)
- Specified by:
evaluateFilter
in interfaceIFilter
-
toJSON
@ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONObject toJSON() throws org.json.JSONException
Produces JSON representation of this filter. Fields are as follows:CommonPropertyNames.PROP_TYPE
:getMatchTypeEnum()
.toString() resultCommonPropertyNames.PROP_FIELDNAME
:getFieldName()
resultCommonPropertyNames.PROP_VALUE
:getMatchValue()
resultCommonPropertyNames.PROP_ISCASESENSITIVE
:isCaseSensitive()
result, if true
-
-