# Class AbstractRole

java.lang.Object
org.apache.catalina.users.AbstractRole

All Implemented Interfaces:
  `Principal, Role`

Direct Known Subclasses:
  `GenericRole`

public abstract class AbstractRole extends Object implements Role

Convenience base class for `Role` implementations.

Since:
  4.1

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected String`
  `description`
  The description of this Role.
  `protected String`
  `rolename`
  The role name of this Role.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbstractRole()`
  Constructs a new AbstractRole.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getDescription()`
  Gets the description of this role.
  `String`
  `getName()`
  Make the principal name the same as the role name.
  `String`
  `getRolename()`
  Gets the role name of this role, which must be unique within the scope of a `UserDatabase`.
  `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 class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface Principal

  `equals, hashCode, implies, toString`

  ### Methods inherited from interface Role

  `getUserDatabase`

- ## Field Details

  - ### description

    protected String description
    The description of this Role.

  - ### rolename

    protected String rolename
    The role name of this Role.

- ## Constructor Details

  - ### AbstractRole

    public AbstractRole()
    Constructs a new AbstractRole.

- ## Method Details

  - ### getDescription

    public String getDescription()
    Description copied from interface: `Role`
    Gets the description of this role.
    Specified by:
      `getDescription` in interface `Role`
    Returns:
      The description of this role

  - ### setDescription

    public void setDescription(String description)
    Description copied from interface: `Role`
    Sets the description of this role.
    Specified by:
      `setDescription` in interface `Role`
    Parameters:
      `description` - The new description

  - ### getRolename

    public String getRolename()
    Description copied from interface: `Role`
    Gets the role name of this role, which must be unique within the scope of a `UserDatabase`.
    Specified by:
      `getRolename` in interface `Role`
    Returns:
      The role name

  - ### setRolename

    public void setRolename(String rolename)
    Description copied from interface: `Role`
    Sets the role name of this role, which must be unique within the scope of a `UserDatabase`.
    Specified by:
      `setRolename` in interface `Role`
    Parameters:
      `rolename` - The new role name

  - ### getName

    public String getName()
    Make the principal name the same as the role name.
    Specified by:
      `getName` in interface `Principal`