Role (Apache Tomcat 10.1.57 API Documentation)
Description: declaration: package: org.apache.catalina, interface: Role

# Interface Role

All Superinterfaces:
  `Principal`

All Known Implementing Classes:
  `AbstractRole, GenericRole, MemoryRole`

public interface Role extends Principal

Abstract representation of a security role, suitable for use in environments like JAAS that want to deal with `Principals`.

Since:
  4.1

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getDescription()`
  Gets the description of this role.
  `String`
  `getRolename()`
  Gets the role name of this role, which must be unique within the scope of a `UserDatabase`.
  `UserDatabase`
  `getUserDatabase()`
  Gets the `UserDatabase` within which this Role is defined.
  `void`
  `setDescription(String description)`
  Sets the description of this role.
  `void`
  `setRolename(String rolename)`
  Sets the role name of this role, which must be unique within the scope of a `UserDatabase`.

  ### Methods inherited from interface Principal

  `equals, getName, hashCode, implies, toString`

- ## Method Details

  - ### getDescription

    String getDescription()
    Gets the description of this role.
    Returns:
      The description of this role

  - ### setDescription

    void setDescription(String description)
    Sets the description of this role.
    Parameters:
      `description` - The new description

  - ### getRolename

    String getRolename()
    Gets the role name of this role, which must be unique within the scope of a `UserDatabase`.
    Returns:
      The role name

  - ### setRolename

    void setRolename(String rolename)
    Sets the role name of this role, which must be unique within the scope of a `UserDatabase`.
    Parameters:
      `rolename` - The new role name

  - ### getUserDatabase

    UserDatabase getUserDatabase()
    Gets the `UserDatabase` within which this Role is defined.
    Returns:
      The UserDatabase within which this Role is defined