Class Order
- java.lang.Object
-
- de.digitalcollections.model.list.sorting.Order
-
public class Order extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Order.OrderBuilder<C extends Order,B extends Order.OrderBuilder<C,B>>
-
Constructor Summary
Constructors Constructor Description Order()
Order(Direction direction, boolean ignoreCase, NullHandling nullHandling, String property)
Order(Direction direction, String property)
Creates a newOrder
instance. if order is null then order defaults toSorting.DEFAULT_DIRECTION
Order(Direction direction, String property, NullHandling nullHandlingHint)
Creates a newOrder
instance. if order is null then order defaults toSorting.DEFAULT_DIRECTION
Order(String property)
Creates a newOrder
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Direction
getDirection()
Returns the order the property shall be sorted for.NullHandling
getNullHandling()
Returns the usedNullHandling
hint, which can but may not be respected by the used datastore.String
getProperty()
Returns the property to order for.Optional<String>
getSubProperty()
Returns the optional sub property to order for.int
hashCode()
protected void
init()
boolean
isAscending()
Returns whether sorting for this property shall be ascending.boolean
isDescending()
Returns whether sorting for this property shall be descending.boolean
isIgnoreCase()
Returns whether or not the sort will be case sensitive.void
setDirection(Direction direction)
void
setIgnoreCase(boolean ignoreCase)
void
setNullHandling(NullHandling nullHandling)
void
setProperty(String property)
void
setSubProperty(String property)
String
toString()
-
-
-
Constructor Detail
-
Order
public Order()
-
Order
public Order(Direction direction, boolean ignoreCase, NullHandling nullHandling, String property)
-
Order
public Order(Direction direction, String property)
Creates a newOrder
instance. if order is null then order defaults toSorting.DEFAULT_DIRECTION
- Parameters:
direction
- can be null, will default toSorting.DEFAULT_DIRECTION
property
- must not be null or empty.
-
Order
public Order(Direction direction, String property, NullHandling nullHandlingHint)
Creates a newOrder
instance. if order is null then order defaults toSorting.DEFAULT_DIRECTION
- Parameters:
direction
- can be null, will default toSorting.DEFAULT_DIRECTION
property
- must not be null or empty.nullHandlingHint
- can be null, will default toNullHandling.NATIVE
.
-
Order
public Order(String property)
Creates a newOrder
instance. Takes a single property. Direction defaults toSorting.DEFAULT_DIRECTION
.- Parameters:
property
- must not be null or empty.
-
-
Method Detail
-
getDirection
public Direction getDirection()
Returns the order the property shall be sorted for.- Returns:
- the order the property shall be sorted for
-
getNullHandling
public NullHandling getNullHandling()
Returns the usedNullHandling
hint, which can but may not be respected by the used datastore.- Returns:
- the used NullHandling hint, which can but may not be respected by the used datastore.
-
getProperty
public String getProperty()
Returns the property to order for.- Returns:
- the property to order for
-
getSubProperty
public Optional<String> getSubProperty()
Returns the optional sub property to order for.A sub property is always related to the main property.
- Returns:
- the optional sub property to order for
-
init
protected void init()
-
isAscending
public boolean isAscending()
Returns whether sorting for this property shall be ascending.- Returns:
- whether sorting for this property shall be ascending
-
isDescending
public boolean isDescending()
Returns whether sorting for this property shall be descending.- Returns:
- whether sorting for this property shall be descending
-
isIgnoreCase
public boolean isIgnoreCase()
Returns whether or not the sort will be case sensitive.- Returns:
- whether or not the sort will be case sensitive
-
setDirection
public void setDirection(Direction direction)
-
setIgnoreCase
public void setIgnoreCase(boolean ignoreCase)
-
setNullHandling
public void setNullHandling(NullHandling nullHandling)
-
setProperty
public void setProperty(String property)
-
setSubProperty
public void setSubProperty(String property)
-
-