Package sk.iway.iwcm.system.datatable
Class SortDefinition
java.lang.Object
sk.iway.iwcm.system.datatable.SortDefinition
Sort definition for use with PageListHolder.
Replacement for deprecated org.springframework.beans.support.MutableSortDefinition.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new SortDefinition with default values (ascending sort, case insensitive).SortDefinition(String property, boolean ignoreCase, boolean ascending) Create a new SortDefinition with the given parameters.SortDefinition(SortDefinition source) Copy constructor for creating a SortDefinition from another SortDefinition. -
Method Summary
Modifier and TypeMethodDescriptionGet the property to sort by.booleanCheck whether to sort ascending or descending.booleanCheck whether upper and lower case in String values should be ignored.voidsetAscending(boolean ascending) Set whether to sort ascending or descending.voidsetIgnoreCase(boolean ignoreCase) Set whether upper and lower case in String values should be ignored.voidsetProperty(String property) Set the property to sort by.
-
Constructor Details
-
SortDefinition
public SortDefinition()Create a new SortDefinition with default values (ascending sort, case insensitive). -
SortDefinition
Create a new SortDefinition with the given parameters.- Parameters:
property- the property to compareignoreCase- whether upper and lower case in String values should be ignoredascending- whether to sort ascending (true) or descending (false)
-
SortDefinition
Copy constructor for creating a SortDefinition from another SortDefinition.- Parameters:
source- the source SortDefinition to copy
-
-
Method Details
-
getProperty
Get the property to sort by.- Returns:
- the property name
-
setProperty
Set the property to sort by.- Parameters:
property- the property name
-
isIgnoreCase
public boolean isIgnoreCase()Check whether upper and lower case in String values should be ignored.- Returns:
- true if case should be ignored
-
setIgnoreCase
public void setIgnoreCase(boolean ignoreCase) Set whether upper and lower case in String values should be ignored.- Parameters:
ignoreCase- true to ignore case
-
isAscending
public boolean isAscending()Check whether to sort ascending or descending.- Returns:
- true for ascending, false for descending
-
setAscending
public void setAscending(boolean ascending) Set whether to sort ascending or descending.- Parameters:
ascending- true for ascending, false for descending
-