public interface ComparatorBuilder
| Modifier and Type | Interface and Description |
|---|---|
static class |
ComparatorBuilder.DefaultComparatorBuilder
The default comparator builder.
|
| Modifier and Type | Method and Description |
|---|---|
default ComparatorBuilder |
add(Comparator<?> comparator)
Adds the given comparator to this builder.
|
default ComparatorBuilder |
add(ComparatorField field)
Creates and adds a value comparator for the given field ordering description.
|
default ComparatorBuilder |
add(ComparatorField field,
ValueExtractor valueExtractor)
Creates and adds a value comparator for the given field ordering description.
|
default ComparatorBuilder |
add(String field,
boolean asc,
boolean ignoreCase,
boolean nullIsFirst)
Creates and adds a value comparator for the given field name or path to this builder.
|
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.
|
default ComparatorBuilder |
add(String field,
Comparator<?> comparator)
Adds the given 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.
|
default ComparatorBuilder |
addAll(Collection<? extends ComparatorField> fields)
Creates and adds value comparators for the given field ordering descriptions.
|
default ComparatorBuilder |
addAll(Collection<? extends ComparatorField> fields,
ValueExtractor valueExtractor)
Creates and adds value comparators for the given field ordering descriptions.
|
default ComparatorBuilder |
addAll(ComparatorFields comparatorFields)
Creates and adds value comparators for the given field ordering descriptions.
|
default ComparatorBuilder |
addAll(ComparatorFields comparatorFields,
ValueExtractor valueExtractor)
Creates and adds value comparators for the given field ordering descriptions.
|
Comparator<Object> |
build()
Build comparator.
|
static ComparatorBuilder |
builder()
Creates a new comparator builder.
|
default ComparatorBuilder |
fromWellKnownText(String wkt)
Creates and adds value comparators for the given well known text description (see
ComparatorField.toWkt(), ComparatorFields.toWkt() and WellKnownTextParser). |
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). |
static ComparatorBuilder builder()
default ComparatorBuilder add(Comparator<?> comparator)
comparator - the comparator (can be null - then no comparator is added)default ComparatorBuilder add(String field, Comparator<?> comparator)
field - the field name or path (can be null)comparator - the comparator (can be null - then no comparator is added)ComparatorBuilder add(String field, ValueExtractor valueExtractor, Comparator<?> comparator)
field - 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)default ComparatorBuilder add(String field, boolean asc, boolean ignoreCase, boolean nullIsFirst)
field - 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 valuesComparatorBuilder add(String field, boolean asc, boolean ignoreCase, boolean nullIsFirst, ValueExtractor valueExtractor)
field - 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 extractordefault ComparatorBuilder add(ComparatorField field)
field - the field ordering description (can be null)default ComparatorBuilder add(ComparatorField field, ValueExtractor valueExtractor)
field - the field ordering description (can be null)valueExtractor - the value extractordefault ComparatorBuilder addAll(Collection<? extends ComparatorField> fields)
fields - the ordering descriptions (can be null - no comparator will be added)default ComparatorBuilder addAll(Collection<? extends ComparatorField> fields, ValueExtractor valueExtractor)
fields - the ordering descriptions (can be null - no comparator will be
added)valueExtractor - the value extractordefault ComparatorBuilder addAll(ComparatorFields comparatorFields)
comparatorFields - the ordering descriptions (can be null - no comparator will be
added)default ComparatorBuilder addAll(ComparatorFields comparatorFields, ValueExtractor valueExtractor)
comparatorFields - the ordering descriptions (can be null - no comparator will be
added)valueExtractor - the value extractordefault ComparatorBuilder fromWellKnownText(String wkt)
ComparatorField.toWkt(), ComparatorFields.toWkt() and WellKnownTextParser).
The syntax of the field ordering description is
fieldNameOrPath0,asc,ignoreCase,nullIsFirst|fieldNameOrPath1,asc,ignoreCase,nullIsFirst
For example
person.lastName,asc,true,false|person.firstName,asc,true,false
wkt - the well known text (field ordering description)ComparatorBuilder fromWellKnownText(String wkt, WellKnownTextParser wktParser)
ComparatorField.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
wkt - the well known text (field ordering description)wktParser - the well known text parser (can be null)Comparator<Object> build()
Copyright © 2019 bremersee.org. All rights reserved.