@ThingworxExtensionApiClass(since={6,6}, canInstantiate=true) public final class GenericSorter extends java.lang.Object implements ISort
Modifier and Type | Field and Description |
---|---|
static boolean |
ASCENDING |
static boolean |
DESCENDING |
Constructor and Description |
---|
GenericSorter() |
GenericSorter(java.lang.String fieldName,
boolean isAscending) |
GenericSorter(java.lang.String fieldName,
boolean isAscending,
boolean isCaseSensitive) |
Modifier and Type | Method and Description |
---|---|
int |
compare(ValueCollection row1,
ValueCollection row2) |
java.lang.String |
getFieldName() |
boolean |
isAscending() |
boolean |
isCaseSensitive() |
void |
resolveFields(DataShapeDefinition metadata) |
void |
setAscending(boolean value) |
void |
setFieldName(java.lang.String value) |
org.json.JSONObject |
toJSON()
Produces JSON representation of this sorter. |
org.json.JSONArray |
toJSONArray()
|
public static final boolean ASCENDING
public static final boolean DESCENDING
@ThingworxExtensionApiMethod(since={6,6}) public GenericSorter(java.lang.String fieldName, boolean isAscending)
@ThingworxExtensionApiMethod(since={6,6}) public GenericSorter(java.lang.String fieldName, boolean isAscending, boolean isCaseSensitive)
@ThingworxExtensionApiMethod(since={6,6}) public GenericSorter()
@ThingworxExtensionApiMethod(since={6,6}) public java.lang.String getFieldName()
getFieldName
in interface ISort
@ThingworxExtensionApiMethod(since={6,6}) public void setFieldName(java.lang.String value)
setFieldName
in interface ISort
@ThingworxExtensionApiMethod(since={6,6}) public boolean isAscending()
isAscending
in interface ISort
@ThingworxExtensionApiMethod(since={6,6}) public void setAscending(boolean value)
setAscending
in interface ISort
@ThingworxExtensionApiMethod(since={6,6}) public void resolveFields(DataShapeDefinition metadata)
resolveFields
in interface ISort
@ThingworxExtensionApiMethod(since={6,6}) public int compare(ValueCollection row1, ValueCollection row2)
compare
in interface java.util.Comparator<ValueCollection>
@ThingworxExtensionApiMethod(since={6,6}) public boolean isCaseSensitive()
isCaseSensitive
in interface ISort
@ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONObject toJSON() throws org.json.JSONException
CommonPropertyNames.PROP_FIELDNAME
: getFieldName()
result
CommonPropertyNames.PROP_ISASCENDING
: isAscending()
result, when false
CommonPropertyNames.PROP_ISCASESENSITIVE
: isCaseSensitive()
result, when false
@ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONArray toJSONArray() throws org.json.JSONException
toJSONArray
in interface ISort
org.json.JSONException
- Upon internal errors