Package com.jbstrap.core.utils
Class SortUtils
java.lang.Object
com.jbstrap.core.utils.SortUtils
Sorting utility methods
- Since:
- 4.0
- Author:
- JBStrap
-
Method Summary
Modifier and TypeMethodDescriptionstatic Map<?,
?> Sorts the map by the key, using the default collatorstatic Map<?,
?> Sorts the map by the key, using the specified rulestatic Map<?,
?> Sorts the map by key, using the defined Collatorstatic Map<?,
?> sortByValue
(Map<?, ?> map) Sorts the map by the element value, using the default collator (US language)static Map<?,
?> sortByValue
(Map<?, ?> map, String rules) Sorts the map by the element valuestatic Map<?,
?> sortByValue
(Map<?, ?> map, Collator collator) Sorts the map by the element value, using the specified collator.
-
Method Details
-
sortByValue
Sorts the map by the element value- Parameters:
map
- The map to be sortedrules
- The sorting rule- Returns:
- The sorted map
-
sortByValue
Sorts the map by the element value, using the default collator (US language)- Parameters:
map
- The map to be sorted- Returns:
- The sorted map
-
sortByValue
Sorts the map by the element value, using the specified collator.- Parameters:
map
- The map to be sortedcollator
- The collator to be used- Returns:
- The sorted map
-
sortByKey
Sorts the map by the key, using the specified rule- Parameters:
map
- The map to be sortedrules
- The sorting rule- Returns:
- The sorted map
-
sortByKey
Sorts the map by the key, using the default collator- Parameters:
map
- The map to be sorted- Returns:
- The sorted map
-
sortByKey
Sorts the map by key, using the defined Collator- Parameters:
map
- The map to be sortedcollator
- The Collator to be used- Returns:
- The sorted map
-