Package org.bremersee.comparator.model
Class SortOrders
java.lang.Object
org.bremersee.comparator.model.SortOrders
The list of sort orders.
- Author:
- Christian Bremer
-
Constructor Summary
ModifierConstructorDescriptionprotected
Instantiates an empty list of sort orders.SortOrders
(Collection<? extends SortOrder> sortOrders) Instantiates a new unmodifiable list of sort orders. -
Method Summary
Modifier and TypeMethodDescriptionstatic SortOrders
Creates new sort orders with the given orders.static SortOrders
fromSortOrdersText
(String source) From sort orders text.static SortOrders
fromSortOrdersText
(String source, SortOrdersTextProperties properties) From sort orders text.Gets the unmodifiable list of sort orders.Creates the sort orders text of this ordering descriptions.getSortOrdersText
(SortOrdersTextProperties properties) Creates the sort orders text of this ordering descriptions.boolean
isEmpty()
Checks whether the list of sort orders is empty or not.boolean
isSorted()
Checks whether this sort orders contains any entries.boolean
Checks whether this sort orders contains any entries.Deprecated.toSortOrdersText
(SortOrdersTextProperties properties) Deprecated.UsegetSortOrdersText(SortOrdersTextProperties)
instead.toString()
-
Constructor Details
-
SortOrders
protected SortOrders()Instantiates an empty list of sort orders. -
SortOrders
Instantiates a new unmodifiable list of sort orders.- Parameters:
sortOrders
- the sort orders
-
-
Method Details
-
getSortOrders
Gets the unmodifiable list of sort orders.- Returns:
- the list of sort orders
-
isEmpty
public boolean isEmpty()Checks whether the list of sort orders is empty or not.- Returns:
true
if the list of sort orders is empty, otherwisefalse
-
isSorted
public boolean isSorted()Checks whether this sort orders contains any entries. If there are entries, this is sorted, otherwise it is unsorted.- Returns:
true
if the list of sort orders is not empty (aka sorted), otherwisefalse
-
isUnsorted
public boolean isUnsorted()Checks whether this sort orders contains any entries. If there are no entries, this is unsorted, otherwise it is sorted.- Returns:
true
if the list of sort orders is empty (aka unsorted), otherwisefalse
-
getSortOrdersText
Creates the sort orders text of this ordering descriptions.The syntax of the ordering description is
fieldNameOrPath0,asc,ignoreCase,nullIsFirst;fieldNameOrPath1,asc,ignoreCase,nullIsFirst
For example
room.number,asc,true,false;person.lastName,asc,true,false;person.firstName,asc,true,false
- Returns:
- the sort orders text
-
toSortOrdersText
Deprecated.UsegetSortOrdersText()
instead.Creates the sort orders text of this ordering descriptions.The syntax of the ordering description is
fieldNameOrPath0,asc,ignoreCase,nullIsFirst;fieldNameOrPath1,asc,ignoreCase,nullIsFirst
For example
room.number,asc,true,false;person.lastName,asc,true,false;person.firstName,asc,true,false
- Returns:
- the sort orders text
-
getSortOrdersText
Creates the sort orders text of this ordering descriptions.The syntax of the ordering description is
fieldNameOrPath0,asc,ignoreCase,nullIsFirst;fieldNameOrPath1,asc,ignoreCase,nullIsFirst
The separators (',') and (';') and the values of
direction
,case-handling
andnull-handling
depend on the givenSortOrdersTextProperties
.For example with default properties:
room.number,asc,true,false;person.lastName,asc,true,false;person.firstName,asc,true,false
- Parameters:
properties
- the properties- Returns:
- the sort orders text
-
toSortOrdersText
Deprecated.UsegetSortOrdersText(SortOrdersTextProperties)
instead.Creates the sort orders text of this ordering descriptions.The syntax of the ordering description is
fieldNameOrPath0,asc,ignoreCase,nullIsFirst;fieldNameOrPath1,asc,ignoreCase,nullIsFirst
The separators (',') and (';') and the values of
direction
,case-handling
andnull-handling
depend on the givenSortOrdersTextProperties
.For example with default properties:
room.number,asc,true,false;person.lastName,asc,true,false;person.firstName,asc,true,false
- Parameters:
properties
- the properties- Returns:
- the sort orders text
-
toString
-
fromSortOrdersText
From sort orders text.- Parameters:
source
- the sort orders text- Returns:
- the sort orders
-
fromSortOrdersText
From sort orders text.- Parameters:
source
- the sort orders textproperties
- the properties- Returns:
- the sort orders
-
by
Creates new sort orders with the given orders.- Parameters:
sortOrders
- the sort orders- Returns:
- the sort orders
-
getSortOrdersText()
instead.