Enum Class UIDataName

java.lang.Object
java.lang.Enum<UIDataName>
org.troy.capstone.constants.UIDataName
All Implemented Interfaces:
Serializable, Comparable<UIDataName>, Constable

public enum UIDataName extends Enum<UIDataName>
Enum for UI data names, to avoid hardcoding strings throughout the codebase and reduce risk of typos.
  • Enum Constant Details

    • MIN_PRICE

      public static final UIDataName MIN_PRICE
      UI data name for the minimum price filter.
    • MAX_PRICE

      public static final UIDataName MAX_PRICE
      UI data name for the maximum price filter.
    • SEARCH_QUERY

      public static final UIDataName SEARCH_QUERY
      UI data name for the search query input.
    • FILTERS_CONTAINER

      public static final UIDataName FILTERS_CONTAINER
      UI data name for the selected category filter.
    • MIN_STAR_RATING

      public static final UIDataName MIN_STAR_RATING
      UI data name for the minimum star rating filter.
    • SORTING_OPTION

      public static final UIDataName SORTING_OPTION
      UI data name for the sorting option.
  • Field Details

    • value

      private final String value
      The string value associated with this enum constant, used for UI data keys.
  • Constructor Details

    • UIDataName

      private UIDataName(String value)
      Constructor a UIDataName enum constant with the specified string value.
      Parameters:
      value - The string value to associate with this enum constant.
  • Method Details

    • values

      public static UIDataName[] 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 UIDataName 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
    • getValue

      public String getValue()
      Getter for the string value associated with this enum constant.
      Returns:
      The string value that can be used as a key in UI data storage.