public static class ComparatorBuilder.DefaultComparatorBuilder extends Object implements ComparatorBuilder
ComparatorBuilder.DefaultComparatorBuilder| Constructor and Description |
|---|
DefaultComparatorBuilder() |
| Modifier and Type | Method and Description |
|---|---|
ComparatorBuilder |
add(String field,
boolean asc,
boolean ignoreCase,
boolean nullIsFirst,
ValueExtractor valueExtractor)
Creates and adds a value comparator for the given field name or path to this builder.
|
ComparatorBuilder |
add(String field,
ValueExtractor valueExtractor,
Comparator<?> comparator)
Adds the given comparator for the given field name or path to this builder.
|
Comparator<Object> |
build()
Build comparator.
|
ComparatorBuilder |
fromWellKnownText(String wkt,
WellKnownTextParser wktParser)
Creates and adds value comparators for the given well known text description (see
ComparatorField.toWkt(), ComparatorFields.toWkt() and WellKnownTextParser). |
public ComparatorBuilder add(String field, ValueExtractor valueExtractor, Comparator<?> comparator)
ComparatorBuilderadd in interface ComparatorBuilderfield - the field name or path (can be null)valueExtractor - the value extractor (can be null)comparator - the comparator (can be null - then no comparator is added)public ComparatorBuilder add(String field, boolean asc, boolean ignoreCase, boolean nullIsFirst, ValueExtractor valueExtractor)
ComparatorBuilderadd in interface ComparatorBuilderfield - the field name or path (can be null)asc - true for an ascending order, false for a descending
orderignoreCase - true for a case insensitive order, false for a case
sensitive ordernullIsFirst - specifies the order of null valuesvalueExtractor - the value extractorpublic ComparatorBuilder fromWellKnownText(String wkt, WellKnownTextParser wktParser)
ComparatorBuilderComparatorField.toWkt(), ComparatorFields.toWkt() and WellKnownTextParser).
The syntax of the field ordering depends on the WellKnownTextParser. The default is
fieldNameOrPath0,asc,ignoreCase,nullIsFirst|fieldNameOrPath1,asc,ignoreCase,nullIsFirst
For example
person.lastName,asc,true,false|person.firstName,asc,true,false
fromWellKnownText in interface ComparatorBuilderwkt - the well known text (field ordering description)wktParser - the well known text parser (can be null)public Comparator<Object> build()
ComparatorBuilderbuild in interface ComparatorBuilderCopyright © 2020 bremersee.org. All rights reserved.