Package Common

Enum Class Role

All Implemented Interfaces:
Serializable, Comparable<Role>, Constable

public enum Role extends Enum<Role>
The Role enum represents the different roles that users can have in the system. It includes roles such as DOC (Doctor), PAT (Patient), PHA (Pharmacist), and ADM (Administrator).
  • Enum Constant Details

    • DOC

      public static final Role DOC
      Represents a Doctor role.
    • PAT

      public static final Role PAT
      Represents a Patient role.
    • PHA

      public static final Role PHA
      Represents a Pharmacist role.
    • ADM

      public static final Role ADM
      Represents an Administrator role.
  • Method Details

    • values

      public static Role[] 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 Role 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
    • fromString

      public static Role fromString(String role)
      Converts a string representation of a role to its corresponding Role enum value.
      Parameters:
      role - the string representation of the role
      Returns:
      the corresponding Role enum value or PAT if the input is invalid