Enum ESortOrder

java.lang.Object
java.lang.Enum<ESortOrder>
com.helger.commons.compare.ESortOrder
All Implemented Interfaces:
ISortOrderIndicator, Serializable, Comparable<ESortOrder>, java.lang.constant.Constable

public enum ESortOrder extends Enum<ESortOrder> implements ISortOrderIndicator
Defines possible sort orders. The default is ASCENDING sorting.
Author:
Philip Helger
  • Enum Constant Details

    • ASCENDING

      public static final ESortOrder ASCENDING
    • DESCENDING

      public static final ESortOrder DESCENDING
  • Field Details

  • Method Details

    • values

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

      public static ESortOrder valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      @Nonnegative public int getValue()
      Returns:
      The associated value for this sort order. The value can directly be used in compare methods to multiply the initial return value with this value to have the correct ordering.
    • getValueAsString

      @Nonnull public String getValueAsString()
    • isAscending

      public boolean isAscending()
      Specified by:
      isAscending in interface ISortOrderIndicator
      Returns:
      true is ascending sort order is active.
    • getAlternate

      @Nonnull public ESortOrder getAlternate()
      Get the alternate sort order. If the current sort order is ascending, the result will be descending and if this is descending, the return will be ascending.
      Returns:
      Never null.
    • getFromValueOrDefault

      @Nonnull public static ESortOrder getFromValueOrDefault(int nValue)
    • getFromValue

      @Nullable public static ESortOrder getFromValue(int nValue, @Nullable ESortOrder eDefault)