Enum Class SortOrder

java.lang.Object
java.lang.Enum<SortOrder>
de.espirit.common.util.SortOrder
All Implemented Interfaces:
Serializable, Comparable<SortOrder>, Constable

public enum SortOrder extends Enum<SortOrder>
Enum providing values to determine the order to be used for sorting. Encapsulates the conversion of attribute values given by templates to future-safe order definitions.
Since:
3.0
  • Enum Constant Details

    • KEEP_ORDER

      public static final SortOrder KEEP_ORDER
      Keep order defined by definition
      Since:
      5.2.241303
    • ASCENDING

      public static final SortOrder ASCENDING
      Sort in ascending order
      Since:
      5.2.241303
    • DESCENDING

      public static final SortOrder DESCENDING
      Sort in descending order
      Since:
      5.2.241303
  • Method Details

    • values

      public static SortOrder[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SortOrder valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • greaterThan

      public int greaterThan()
      Return the comparison result value for greater than depending on the order for sorting.
      Returns:
      The according comparison result.
      Since:
      5.2.241303
    • isLanguageDependent

      public boolean isLanguageDependent()
      Indicates, whether the sort ordering depends on language dependent sorting criteria.
      Returns:
      true if language dependent, false otherwise
      Since:
      5.2.241303
    • getOrder

      public static SortOrder getOrder(String code, SortOrder defaultOrder)
      Get the order value by a given code.
      Parameters:
      code - The code to look up the ordering for or null or an empty string (will return defaultOrder)
      defaultOrder - The default order to be returned.
      Returns:
      The matching order or defaultOrder.
      Since:
      5.2.241303
    • valueOf

      @Nullable public static @Nullable SortOrder valueOf(Integer code)
      Exceptional handling to find a sort order by its order code.
      Parameters:
      code - The order code.
      Returns:
      The matching SortOrder or null.
      Since:
      5.2.241303