Class SortUtils

java.lang.Object
com.jbstrap.core.utils.SortUtils

public final class SortUtils extends Object
Sorting utility methods
Since:
4.0
Author:
JBStrap
  • Method Details

    • sortByValue

      public static Map<?,?> sortByValue(Map<?,?> map, String rules)
      Sorts the map by the element value
      Parameters:
      map - The map to be sorted
      rules - The sorting rule
      Returns:
      The sorted map
    • sortByValue

      public static Map<?,?> sortByValue(Map<?,?> map)
      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

      public static Map<?,?> sortByValue(Map<?,?> map, Collator collator)
      Sorts the map by the element value, using the specified collator.
      Parameters:
      map - The map to be sorted
      collator - The collator to be used
      Returns:
      The sorted map
    • sortByKey

      public static Map<?,?> sortByKey(Map<?,?> map, String rules)
      Sorts the map by the key, using the specified rule
      Parameters:
      map - The map to be sorted
      rules - The sorting rule
      Returns:
      The sorted map
    • sortByKey

      public static Map<?,?> sortByKey(Map<?,?> map)
      Sorts the map by the key, using the default collator
      Parameters:
      map - The map to be sorted
      Returns:
      The sorted map
    • sortByKey

      public static Map<?,?> sortByKey(Map<?,?> map, Collator collator)
      Sorts the map by key, using the defined Collator
      Parameters:
      map - The map to be sorted
      collator - The Collator to be used
      Returns:
      The sorted map