Enum Class MeasuringUnit

java.lang.Object
java.lang.Enum<MeasuringUnit>
no.ntnu.idatt1002.demo.data.recipes.MeasuringUnit
All Implemented Interfaces:
Serializable, Comparable<MeasuringUnit>, Constable

public enum MeasuringUnit extends Enum<MeasuringUnit>
The enum class defines a set of valid units of measurements related to the ingredients and recipes. The label property of each constant provides a lower-case representation of each unit that can be used in presentation to the user.
Since:
13.03.2023
Author:
hannesofie
  • Enum Constant Details

  • Field Details

    • label

      public final String label
      Label of the categories. The label formats the string value of the categories two string in lower caps.
  • Method Details

    • values

      public static MeasuringUnit[] 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 MeasuringUnit 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