Package net.solarnetwork.domain
Class MutableSortDescriptor
java.lang.Object
net.solarnetwork.domain.MutableSortDescriptor
- All Implemented Interfaces:
SortDescriptor
Mutable implementation of
SortDescriptor.
The descending property defaults to false.- Version:
- 1.1
- Author:
- matt
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct with ascending order.MutableSortDescriptor(String sortKey) Construct with a sort key.MutableSortDescriptor(String sortKey, boolean descending) Construct with a sort key and order. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet the name of the value to sort by.inthashCode()booleanReturn true if the sort should be in descending order, otherwise the short should be in ascending order.voidsetDescending(boolean descending) Set the descending flag.voidsetSortKey(String sortKey) Set the sort key.
-
Constructor Details
-
MutableSortDescriptor
public MutableSortDescriptor()Construct with ascending order. -
MutableSortDescriptor
Construct with a sort key. Ascending order will be used.- Parameters:
sortKey- the sort key
-
MutableSortDescriptor
Construct with a sort key and order.- Parameters:
sortKey- the sort keydescending-trueto sort in descending order,falsefor ascending
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
getSortKey
Description copied from interface:SortDescriptorGet the name of the value to sort by.How this value is interpreted is implementation dependent.
- Specified by:
getSortKeyin interfaceSortDescriptor- Returns:
- the sort key
-
setSortKey
Set the sort key.- Parameters:
sortKey- the key to set
-
isDescending
public boolean isDescending()Description copied from interface:SortDescriptorReturn true if the sort should be in descending order, otherwise the short should be in ascending order.- Specified by:
isDescendingin interfaceSortDescriptor- Returns:
- true if the sort should be in descending order
-
setDescending
public void setDescending(boolean descending) Set the descending flag.- Parameters:
descending- the flag to set
-