Enum Class WorkWeight

java.lang.Object
java.lang.Enum<WorkWeight>
no.ntnu.principes.domain.task.WorkWeight
All Implemented Interfaces:
Serializable, Comparable<WorkWeight>, Constable

public enum WorkWeight extends Enum<WorkWeight>
Categorizes tasks based on their difficulty or effort level. Provides predefined difficulty levels from very easy to very hard. Each category has a numeric value for computational purposes and a human-readable description.
  • Enum Constant Details

  • Method Details

    • values

      public static WorkWeight[] 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 WorkWeight 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
    • fromInt

      public static WorkWeight fromInt(int workWeight)
      Finds the WorkWeight enum constant corresponding to a numeric value.
      Parameters:
      workWeight - The numeric value to convert (1-5)
      Returns:
      The matching WorkWeight, or EASY if no match is found
    • toString

      public String toString()
      Returns the human-readable difficulty description.
      Overrides:
      toString in class Enum<WorkWeight>
      Returns:
      The difficulty level as a string (e.g., "Medium")