public class ComparatorField extends Object
--------------------------------------------------------------------------------------------- | Attribute | Description | Default | |--------------|-------------------------------------------------------------------|----------| | add | The add name (or method name) of the object. It can be a path. | null | | | The segments are separated by a dot (.): field0.field1.field2 | | |--------------|-------------------------------------------------------------------|----------| | asc or desc | Defines ascending or descending ordering. | asc | |--------------|-------------------------------------------------------------------|----------| | ignoreCase | Makes a case ignoring comparison (only for strings). | true | |--------------|-------------------------------------------------------------------|----------| | nullIsFirst | Defines the ordering if one of the values is null. | false | ---------------------------------------------------------------------------------------------
These values have a 'well known text' representation. The values are concatenated with comma (,):
fieldNameOrPath,asc,ignoreCase,nullIsFirst
For example:
properties.customSettings.priority,asc,true,false
Defaults can be omitted. This is the same:
properties.customSettings.priority
The building of a chain is done by concatenate the fields with a pipe (|):
field0,asc,ignoreCase,nullIsFirst|field1,asc,ignoreCase,nullIsFirst
| Constructor and Description |
|---|
ComparatorField()
Instantiates a new comparator field.
|
ComparatorField(String field,
boolean asc,
boolean ignoreCase,
boolean nullIsFirst)
Instantiates a new comparator field.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
String |
getField()
Gets field name or path.
|
int |
hashCode() |
boolean |
isAsc()
Is ascending or descending order.
|
boolean |
isIgnoreCase()
Is case insensitive or sensitive order.
|
boolean |
isNullIsFirst()
Is null is first.
|
String |
toString() |
String |
toWkt()
Creates the well known text of this field ordering description.
|
public ComparatorField()
public ComparatorField(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 valuespublic String getField()
public boolean isAsc()
true if ascending order, false if descending orderpublic boolean isIgnoreCase()
true if case insensitive order, false if case sensitive orderpublic boolean isNullIsFirst()
true if null is first, otherwise falsepublic String toWkt()
The syntax of the field ordering description is
fieldNameOrPath,asc,ignoreCase,nullIsFirst
For example
person.lastName,asc,true,false
Copyright © 2020 bremersee.org. All rights reserved.