Enum Class ComponentSpec.Direction

java.lang.Object
java.lang.Enum<ComponentSpec.Direction>
edu.ntnu.idi.idatt.dto.ComponentSpec.Direction
All Implemented Interfaces:
Serializable, Comparable<ComponentSpec.Direction>, Constable
Enclosing class:
ComponentSpec

public static enum ComponentSpec.Direction extends Enum<ComponentSpec.Direction>
Enum representing the direction of a component's dimension (width or height).
  • Enum Constant Details

  • Method Details

    • values

      public static ComponentSpec.Direction[] 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 ComponentSpec.Direction 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
    • fromCode

      public static ComponentSpec.Direction fromCode(char code)
      Converts a character code to its corresponding Direction enum.
      Parameters:
      code - The character code ('U', 'D', 'L', 'R').
      Returns:
      The ComponentSpec.Direction enum.
      Throws:
      IllegalArgumentException - if the code is invalid.