Enum Class TableColumnName

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

public enum TableColumnName extends Enum<TableColumnName>
Enum for column names in the dataset, to avoid hardcoding strings throughout the codebase and reduce risk of typos.
  • Enum Constant Details

    • INDEX

      public static final TableColumnName INDEX
      Column name for the index of the item.
    • ID

      public static final TableColumnName ID
      Column name for the ID of the item.
    • IMAGE_URL

      public static final TableColumnName IMAGE_URL
      Column name for the URL of the item's image.
    • NAME

      public static final TableColumnName NAME
      Column name for the name of the item.
    • PUBLISHER

      public static final TableColumnName PUBLISHER
      Column name for the publisher of the item.
    • DESCRIPTION

      public static final TableColumnName DESCRIPTION
      Column name for the description of the item.
    • CATEGORY

      public static final TableColumnName CATEGORY
      Column name for the category of the item.
    • TAGS

      public static final TableColumnName TAGS
      Column name for the tags associated with the item.
    • PRICE

      public static final TableColumnName PRICE
      Column name for the price of the item.
    • REVIEW_SCORE

      public static final TableColumnName REVIEW_SCORE
      Column name for the review score of the item.
    • REVIEW_COUNT

      public static final TableColumnName REVIEW_COUNT
      Column name for the review count of the item.
    • STOCK_QUANTITY

      public static final TableColumnName STOCK_QUANTITY
      Column name for the stock quantity of the item.
    • DATE_ADDED

      public static final TableColumnName DATE_ADDED
      Column name for the date the item was added.
    • PHOTO_AUTHOR

      public static final TableColumnName PHOTO_AUTHOR
      Column name for the author of the item's photo.
    • PHOTO_AUTHOR_URL

      public static final TableColumnName PHOTO_AUTHOR_URL
      Column name for the URL of the page for the author of the item's photo.
    • RELEVANCE

      public static final TableColumnName RELEVANCE
      Column name for the relevance score of the item.
  • Field Details

    • columnName

      private final String columnName
      The column name represented by this enum constant.
    • categoricalColumns

      private static final Set<TableColumnName> categoricalColumns
      Set of column names that are considered categorical variables.
  • Constructor Details

    • TableColumnName

      private TableColumnName(String columnName)
      Constructor for the enum constants.
      Parameters:
      columnName - The string representation of the column name associated with this enum constant.
  • Method Details

    • values

      public static TableColumnName[] 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 TableColumnName 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
    • getCategoricalColumns

      public static Set<TableColumnName> getCategoricalColumns()
      Getter for the set of categorical column names.
      Returns:
      A set of TableColumnName enums that are considered categorical variables.
    • getColumnName

      public String getColumnName()
      Getter for the column name associated with this enum constant.
      Returns:
      The column name as a string.