Package com.thingworx.types.data.filters
Class SetFilter
- java.lang.Object
-
- com.thingworx.types.data.filters.SetFilter
-
- All Implemented Interfaces:
IFilter
@ThingworxExtensionApiClass(since={6,6}, canInstantiate=true) public final class SetFilter extends java.lang.Object implements IFilter
Filter which applies an "in" (or "not in") criteria.
-
-
Constructor Summary
Constructors Constructor Description SetFilter(java.lang.String fieldName, java.util.ArrayList<?> items, java.lang.Boolean inclusive)
Create case-insensitive set filter.SetFilter(java.lang.String fieldName, java.util.Collection<?> items, boolean inclusive)
Create case-insensitive set filter.SetFilter(java.lang.String fieldName, java.util.Collection<?> items, boolean inclusive, 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.java.util.Collection<java.lang.Object>
getMatchItems()
boolean
isCaseSensitive()
boolean
isInclusive()
void
resolveFields(DataShapeDefinition metadata)
Converts match items to field type indicated by the provided DataShapeDefinition, if one is so indicated.void
setFieldName(java.lang.String value)
void
setFilterExpression(java.lang.String expression)
Deprecated.org.json.JSONObject
toJSON()
Produces JSON representation of this filter.
-
-
-
Constructor Detail
-
SetFilter
@ThingworxExtensionApiMethod(since={6,6}) public SetFilter(java.lang.String fieldName, java.util.ArrayList<?> items, java.lang.Boolean inclusive)
Create case-insensitive set filter.
-
SetFilter
@ThingworxExtensionApiMethod(since={6,6}) public SetFilter(java.lang.String fieldName, java.util.Collection<?> items, boolean inclusive)
Create case-insensitive set filter.
-
SetFilter
@ThingworxExtensionApiMethod(since={6,6}) public SetFilter(java.lang.String fieldName, java.util.Collection<?> items, boolean inclusive, boolean caseSensitive)
-
-
Method Detail
-
resolveFields
@ThingworxExtensionApiMethod(since={6,6}) public void resolveFields(DataShapeDefinition metadata)
Converts match items to field type indicated by the provided DataShapeDefinition, if one is so indicated. Beware: there is no guarantee that the conversion is lossless.- Specified by:
resolveFields
in interfaceIFilter
- Parameters:
metadata
- Data shape definition that may provide target field type; may be null
-
isInclusive
@ThingworxExtensionApiMethod(since={6,6}) public boolean isInclusive()
-
isCaseSensitive
@ThingworxExtensionApiMethod(since={6,6}) public boolean isCaseSensitive()
-
getMatchItems
@ThingworxExtensionApiMethod(since={6,6}) public java.util.Collection<java.lang.Object> getMatchItems()
-
getFieldName
@ThingworxExtensionApiMethod(since={6,6}) public java.lang.String getFieldName()
- Specified by:
getFieldName
in interfaceIFilter
-
setFieldName
@ThingworxExtensionApiMethod(since={6,6}) public void setFieldName(java.lang.String value)
- Specified by:
setFieldName
in interfaceIFilter
-
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)
-
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
:FilterFactory.FILTER_IN
whenisInclusive()
is true; otherwiseFilterFactory.FILTER_NOT_IN
CommonPropertyNames.PROP_FIELDNAME
:getFieldName()
resultCommonPropertyNames.PROP_VALUES
: new JSONArray ofgetMatchItems()
resultCommonPropertyNames.PROP_ISCASESENSITIVE
:isCaseSensitive()
result, if true
-
-