GenericRole (Apache Tomcat 9.0.107 API Documentation)
Description: declaration: package: org.apache.catalina.users, class: GenericRole

# Class GenericRole<UD extends UserDatabase>

java.lang.Object
org.apache.catalina.users.AbstractRole
org.apache.catalina.users.GenericRole<UD>

Type Parameters:
  `UD` - The specific type of UserDase with which this role is associated

All Implemented Interfaces:
  `Principal`, `Role`

Direct Known Subclasses:
  `MemoryRole`

public class GenericRole<UD extends UserDatabase> extends AbstractRole

Concrete implementation of `Role` for a `UserDatabase`.

Author:
  Craig R. McClanahan

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final UserDatabase`
  `database`
  The `UserDatabase` that owns this role.

  ### Fields inherited from class org.apache.catalina.users.AbstractRole

  `description, rolename`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `UserDatabase`
  `getUserDatabase()`
  `int`
  `hashCode()`
  `void`
  `setDescription(String description)`
  Set the description of this role.
  `void`
  `setRolename(String rolename)`
  Set the role name of this role, which must be unique within the scope of a `UserDatabase`.

  ### Methods inherited from class org.apache.catalina.users.AbstractRole

  `getDescription, getName, getRolename`

  ### Methods inherited from class java.lang.Object

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

  ### Methods inherited from interface java.security.Principal

  `implies, toString`

- ## Field Details

  - ### database

    protected final UserDatabase database
    The `UserDatabase` that owns this role.

- ## Method Details

  - ### getUserDatabase

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

  - ### setDescription

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

  - ### setRolename

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

  - ### equals

    public boolean equals(Object obj)
    Specified by:
      `equals` in interface `Principal`
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Specified by:
      `hashCode` in interface `Principal`
    Overrides:
      `hashCode` in class `Object`