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 Object
implements IFilter
Filter which applies an "in" (or "not in") criteria.
-
Constructor Summary
ConstructorsConstructorDescription
Create case-insensitive set filter.SetFilter
(String fieldName, Collection<?> items, boolean inclusive)
Create case-insensitive set filter.SetFilter
(String fieldName, Collection<?> items, boolean inclusive, boolean caseSensitive) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
evaluateValue
(IPrimitiveType iPrimitive) Deprecated.boolean
boolean
void
resolveFields
(DataShapeDefinition metadata)
Converts match items to field type indicated by the provided DataShapeDefinition, if one is so indicated.void
setFieldName
(String value) void
setFilterExpression
(String expression) Deprecated.org.json.JSONObject
toJSON()
Produces JSON representation of this filter.
-
Constructor Details
-
SetFilter
@ThingworxExtensionApiMethod(since={6,6}) public SetFilter(String fieldName, ArrayList<?> items, Boolean inclusive)
Create case-insensitive set filter. -
SetFilter
@ThingworxExtensionApiMethod(since={6,6}) public SetFilter(String fieldName, Collection<?> items, boolean inclusive)
Create case-insensitive set filter. -
SetFilter
@ThingworxExtensionApiMethod(since={6,6}) public SetFilter(String fieldName, Collection<?> items, boolean inclusive, boolean caseSensitive)
-
-
Method Details
-
resolveFields
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
-
isCaseSensitive
-
getMatchItems
-
getFieldName
- Specified by:
getFieldName
in interfaceIFilter
-
setFieldName
- Specified by:
setFieldName
in interfaceIFilter
-
setFilterExpression
@Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={7,1}) public void setFilterExpression(String expression) Deprecated.Description copied from interface:IFilter
Sets the filter expression.- Specified by:
setFilterExpression
in interfaceIFilter
- Parameters:
expression
- the filter expression- See Also:
-
getFilterExpression
@Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={7,1}) public String getFilterExpression()Deprecated.Description copied from interface:IFilter
Gets the filter expression.- Specified by:
getFilterExpression
in interfaceIFilter
- Returns:
- the filter expression
- See Also:
-
evaluateValue
- Specified by:
evaluateValue
in interfaceIFilter
-
evaluateFilter
- 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
-