Package net.solarnetwork.domain
Class SimpleSortDescriptor
java.lang.Object
net.solarnetwork.domain.SimpleSortDescriptor
- All Implemented Interfaces:
SortDescriptor
Implementation of
SortDescriptor.- Version:
- 1.1
- Author:
- matt
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleSortDescriptor(String sortKey) Construct with a sort key.SimpleSortDescriptor(String sortKey, boolean descending) Constructor. -
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.static List<SortDescriptor>Create a list of ascending sort descriptors.toString()
-
Constructor Details
-
SimpleSortDescriptor
Construct with a sort key. Ascending order will be used.- Parameters:
sortKey- the sort key
-
SimpleSortDescriptor
Constructor.- Parameters:
sortKey- the sort keydescending- the descending flag
-
-
Method Details
-
sorts
Create a list of ascending sort descriptors.- Parameters:
keys- the sort keys- Returns:
- the descriptors, or null if
keyshas no elements
-
toString
-
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
-
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
-