public class JsonComparator
extends java.lang.Object
implements java.util.Comparator<org.json.JSONObject>
StringUtil.getCollator()
will be usedStringUtil.getCollator()
Constructor and Description |
---|
JsonComparator(java.lang.String attributes)
Creates a new comparator object to sort according to the passed attributes
|
JsonComparator(java.lang.String[] attributes)
Creates a new comparator object to sort according to the passed attributes
|
Modifier and Type | Method and Description |
---|---|
int |
compare(org.json.JSONObject a,
org.json.JSONObject b) |
public JsonComparator(java.lang.String attributes)
attributes
- the name of the attributes by which sorting should be performed, e.g. "firstAttr,-secondAttr" means
first sort ascending by 'firstAttr' and then (if necessary) sort descending by 'secondAttr'public JsonComparator(java.lang.String[] attributes)
attributes
- the name of the attributes by which sorting should be performed, e.g. ["firstAttr","-secondAttr"] means
first sort ascending by 'firstAttr' and then (if necessary) sort descending by 'secondAttr'@enterprise 9.0.33982 Copyright © 2001-2023 Groiss Informatics GmbH. All Rights Reserved.