Enum Class TimeWeight

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

public enum TimeWeight extends Enum<TimeWeight>
Categorizes tasks based on the estimated time required to complete them. Provides predefined time ranges from very short (5-15 minutes) to very long (2+ hours). Each category has a numeric value for computational purposes and a human-readable description.
  • Enum Constant Details

  • Method Details

    • values

      public static TimeWeight[] 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 TimeWeight 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 TimeWeight fromInt(int timeWeight)
      Finds the TimeWeight enum constant corresponding to a numeric value.
      Parameters:
      timeWeight - The numeric value to convert (1-5)
      Returns:
      The matching TimeWeight, or VERY_LONG if no match is found
    • toString

      public String toString()
      Returns the human-readable time range description.
      Overrides:
      toString in class Enum<TimeWeight>
      Returns:
      The time range as a string (e.g., "30m - 1h")