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
ConstructorsModifierConstructorDescriptionprotectedInstantiates an empty list of sort orders.SortOrders(Collection<? extends SortOrder> sortOrders) Instantiates a new unmodifiable list of sort orders. -
Method Summary
Modifier and TypeMethodDescriptionstatic SortOrdersCreates new sort orders with the given orders.static SortOrdersfromSortOrdersText(String source) From sort orders text.static SortOrdersfromSortOrdersText(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.booleanisEmpty()Checks whether the list of sort orders is empty or not.booleanisSorted()Checks whether this sort orders contains any entries.booleanChecks 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:
trueif 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:
trueif 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:
trueif 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-handlingandnull-handlingdepend 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-handlingandnull-handlingdepend 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.