Class OrderImpl
- java.lang.Object
-
- de.digitalcollections.model.impl.paging.OrderImpl
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface de.digitalcollections.model.api.paging.Order
Order.Builder
-
-
Constructor Summary
Constructors Constructor Description OrderImpl()OrderImpl(Direction direction, boolean ignoreCase, NullHandling nullHandling, String property)OrderImpl(Direction direction, String property)Creates a newOrderinstance. if order is null then order defaults toSorting.DEFAULT_DIRECTIONOrderImpl(Direction direction, String property, NullHandling nullHandlingHint)Creates a newOrderinstance. if order is null then order defaults toSorting.DEFAULT_DIRECTIONOrderImpl(String property)Creates a newOrderinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)DirectiongetDirection()Returns the order the property shall be sorted for.NullHandlinggetNullHandling()Returns the usedNullHandlinghint, which can but may not be respected by the used datastore.StringgetProperty()Returns the property to order for.inthashCode()OrderignoreCase()Returns a newOrderwith case insensitive sorting enabled.booleanisAscending()Returns whether sorting for this property shall be ascending.booleanisDescending()Returns whether sorting for this property shall be descending.booleanisIgnoreCase()Returns whether or not the sort will be case sensitive.OrdernullsFirst()Returns aOrderwithNullHandling.NULLS_FIRSTas null handling hint.OrdernullsLast()Returns aOrderwithNullHandling.NULLS_LASTas null handling hint.OrdernullsNative()Returns aOrderwithNullHandling.NATIVEas null handling hint.voidsetDirection(Direction direction)voidsetIgnoreCase(boolean ignoreCase)voidsetNullHandling(NullHandling nullHandling)voidsetProperty(String property)StringtoString()Orderwith(Direction direction)Orderwith(NullHandling nullHandling)Returns aOrderwith the givenNullHandling.SortingwithProperties(String... properties)Returns a newSortinginstance for the given properties.OrderwithProperty(String property)Returns a newOrder
-
-
-
Constructor Detail
-
OrderImpl
public OrderImpl()
-
OrderImpl
public OrderImpl(Direction direction, boolean ignoreCase, NullHandling nullHandling, String property)
-
OrderImpl
public OrderImpl(Direction direction, String property)
Creates a newOrderinstance. if order is null then order defaults toSorting.DEFAULT_DIRECTION- Parameters:
direction- can be null, will default toSorting.DEFAULT_DIRECTIONproperty- must not be null or empty.
-
OrderImpl
public OrderImpl(Direction direction, String property, NullHandling nullHandlingHint)
Creates a newOrderinstance. if order is null then order defaults toSorting.DEFAULT_DIRECTION- Parameters:
direction- can be null, will default toSorting.DEFAULT_DIRECTIONproperty- must not be null or empty.nullHandlingHint- can be null, will default toNullHandling.NATIVE.
-
OrderImpl
public OrderImpl(String property)
Creates a newOrderinstance. Takes a single property. Direction defaults toSorting.DEFAULT_DIRECTION.- Parameters:
property- must not be null or empty.
-
-
Method Detail
-
setDirection
public void setDirection(Direction direction)
-
setIgnoreCase
public void setIgnoreCase(boolean ignoreCase)
-
setNullHandling
public void setNullHandling(NullHandling nullHandling)
-
setProperty
public void setProperty(String property)
-
getDirection
public Direction getDirection()
Returns the order the property shall be sorted for.- Specified by:
getDirectionin interfaceOrder- Returns:
- the order the property shall be sorted for
-
getNullHandling
public NullHandling getNullHandling()
Returns the usedNullHandlinghint, which can but may not be respected by the used datastore.- Specified by:
getNullHandlingin interfaceOrder- 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.- Specified by:
getPropertyin interfaceOrder- Returns:
- the property to order for
-
ignoreCase
public Order ignoreCase()
Returns a newOrderwith case insensitive sorting enabled.- Specified by:
ignoreCasein interfaceOrder- Returns:
- a new Order with case insensitive sorting enabled
-
isAscending
public boolean isAscending()
Returns whether sorting for this property shall be ascending.- Specified by:
isAscendingin interfaceOrder- Returns:
- whether sorting for this property shall be ascending
-
isDescending
public boolean isDescending()
Returns whether sorting for this property shall be descending.- Specified by:
isDescendingin interfaceOrder- Returns:
- whether sorting for this property shall be descending
-
isIgnoreCase
public boolean isIgnoreCase()
Returns whether or not the sort will be case sensitive.- Specified by:
isIgnoreCasein interfaceOrder- Returns:
- whether or not the sort will be case sensitive
-
nullsFirst
public Order nullsFirst()
Returns aOrderwithNullHandling.NULLS_FIRSTas null handling hint.- Specified by:
nullsFirstin interfaceOrder- Returns:
- an Order with NullHandling#NULLS_FIRST as null handling hint
-
nullsLast
public Order nullsLast()
Returns aOrderwithNullHandling.NULLS_LASTas null handling hint.
-
nullsNative
public Order nullsNative()
Returns aOrderwithNullHandling.NATIVEas null handling hint.- Specified by:
nullsNativein interfaceOrder- Returns:
- an Order with NullHandling#NATIVE as null handling hint.
-
with
public Order with(NullHandling nullHandling)
Returns aOrderwith the givenNullHandling.
-
withProperties
public Sorting withProperties(String... properties)
Returns a newSortinginstance for the given properties.- Specified by:
withPropertiesin interfaceOrder- Parameters:
properties- given properties- Returns:
- a new SortingImpl for the given properties
-
withProperty
public Order withProperty(String property)
Returns a newOrder- Specified by:
withPropertyin interfaceOrder- Parameters:
property- must not be null or empty.- Returns:
- a new Order
-
-