public interface WellKnownTextParser
The default implementation supports the following syntax:
fieldNameOrPath0,asc,ignoreCase,nullIsFirst|fieldNameOrPath1,asc,ignoreCase,nullIsFirst
For example
person.lastName,asc,true,false|person.firstName,asc,true,false
| Modifier and Type | Method and Description |
|---|---|
Comparator |
apply(ComparatorField comparatorField)
Creates the comparator for the given field.
|
default ComparatorField |
buildComparatorField(String fieldDescription)
Builds a comparator field from the string representation of a sort order (must be a single
field, not a path).
|
default List<ComparatorField> |
buildComparatorFields(String wkt)
Builds a list of comparator fields from the string representation of a sort order.
|
static boolean |
findBooleanPart(String fieldDescription,
String delimiter,
int index,
boolean defaultValue,
String... expectedValues)
Finds a boolean part of the field description.
|
static String |
findStringPart(String fieldDescription,
String delimiter,
int index)
Finds a string part of the field description.
|
default Comparator<Object> |
parse(String wkt)
Parses the string representation of a sort order and creates a comparator.
|
default Comparator<Object> parse(String wkt)
The default implementation supports the following syntax:
fieldNameOrPath0,asc,ignoreCase,nullIsFirst|fieldNameOrPath1,asc,ignoreCase,nullIsFirst
For example
person.lastName,asc,true,false|person.firstName,asc,true,false
wkt - the string representation of a sort order (as well known text)default List<ComparatorField> buildComparatorFields(String wkt)
The default implementation supports the following syntax:
fieldNameOrPath0,asc,ignoreCase,nullIsFirst|fieldNameOrPath1,asc,ignoreCase,nullIsFirst
For example
person.lastName,asc,true,false|person.firstName,asc,true,false
wkt - the string representation of a sort order (as well known text)default ComparatorField buildComparatorField(String fieldDescription)
The default implementation supports the following syntax:
fieldNameOrPath,asc,ignoreCase,nullIsFirst
For example
person.lastName,asc,true,false
fieldDescription - the field descriptionComparator apply(ComparatorField comparatorField)
comparatorField - the comparator fieldstatic String findStringPart(String fieldDescription, String delimiter, int index)
fieldDescription - the field descriptiondelimiter - the delimiterindex - the indexstatic boolean findBooleanPart(String fieldDescription, String delimiter, int index, boolean defaultValue, String... expectedValues)
fieldDescription - the field descriptiondelimiter - the delimiterindex - the indexdefaultValue - the default valueexpectedValues - the expected valuesCopyright © 2020 bremersee.org. All rights reserved.