org.keycloak.models.jpa

## Class RoleAdapter

- java.lang.Object
- - org.keycloak.models.jpa.RoleAdapter

- All Implemented Interfaces:
    JpaModel<RoleEntity>, RoleModel

      public class RoleAdapter
      extends Object
      implements RoleModel, JpaModel<RoleEntity>

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected javax.persistence.EntityManager` | `em`
    `protected RealmModel` | `realm`
    `protected RoleEntity` | `role`
    `protected KeycloakSession` | `session`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RoleAdapter(KeycloakSession session, RealmModel realm, javax.persistence.EntityManager em, RoleEntity role)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCompositeRole(RoleModel role)`
    `boolean` | `equals(Object o)`
    `Map<String,List<String>>` | `getAttributes()`
    `Stream<String>` | `getAttributeStream(String name)`
    `Stream<RoleModel>` | `getCompositesStream()`
    `RoleContainerModel` | `getContainer()`
    `String` | `getContainerId()`
    `String` | `getDescription()`
    `RoleEntity` | `getEntity()`
    `String` | `getId()`
    `String` | `getName()`
    `int` | `hashCode()`
    `boolean` | `hasRole(RoleModel role)`
    `boolean` | `isClientRole()`
    `boolean` | `isComposite()`
    `void` | `removeAttribute(String name)`
    `void` | `removeCompositeRole(RoleModel role)`
    `void` | `setAttribute(String name, List<String> values)`
    `void` | `setDescription(String description)`
    `void` | `setName(String name)`
    `void` | `setRole(RoleEntity role)`
    `void` | `setSingleAttribute(String name, String value)`

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

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

    - ### Methods inherited from interface org.keycloak.models.RoleModel

      `getAttribute, getComposites, getFirstAttribute`

- - ### Field Detail

    - #### role

          protected RoleEntity role

    - #### em

          protected javax.persistence.EntityManager em

    - #### realm

          protected RealmModel realm

    - #### session

          protected KeycloakSession session

  - ### Constructor Detail

    - #### RoleAdapter

          public RoleAdapter(KeycloakSession session,
                             RealmModel realm,
                             javax.persistence.EntityManager em,
                             RoleEntity role)

  - ### Method Detail

    - #### getEntity

          public RoleEntity getEntity()

      Specified by:
        `getEntity` in interface `JpaModel<RoleEntity>`

    - #### setRole

          public void setRole(RoleEntity role)

    - #### getName

          public String getName()

      Specified by:
        `getName` in interface `RoleModel`

    - #### getDescription

          public String getDescription()

      Specified by:
        `getDescription` in interface `RoleModel`

    - #### setDescription

          public void setDescription(String description)

      Specified by:
        `setDescription` in interface `RoleModel`

    - #### getId

          public String getId()

      Specified by:
        `getId` in interface `RoleModel`

    - #### setName

          public void setName(String name)

      Specified by:
        `setName` in interface `RoleModel`

    - #### isComposite

          public boolean isComposite()

      Specified by:
        `isComposite` in interface `RoleModel`

    - #### addCompositeRole

          public void addCompositeRole(RoleModel role)

      Specified by:
        `addCompositeRole` in interface `RoleModel`

    - #### removeCompositeRole

          public void removeCompositeRole(RoleModel role)

      Specified by:
        `removeCompositeRole` in interface `RoleModel`

    - #### getCompositesStream

          public Stream<RoleModel> getCompositesStream()

      Specified by:
        `getCompositesStream` in interface `RoleModel`

    - #### hasRole

          public boolean hasRole(RoleModel role)

      Specified by:
        `hasRole` in interface `RoleModel`

    - #### setSingleAttribute

          public void setSingleAttribute(String name,
                                         String value)

      Specified by:
        `setSingleAttribute` in interface `RoleModel`

    - #### setAttribute

          public void setAttribute(String name,
                                   List<String> values)

      Specified by:
        `setAttribute` in interface `RoleModel`

    - #### removeAttribute

          public void removeAttribute(String name)

      Specified by:
        `removeAttribute` in interface `RoleModel`

    - #### getAttributeStream

          public Stream<String> getAttributeStream(String name)

      Specified by:
        `getAttributeStream` in interface `RoleModel`

    - #### getAttributes

          public Map<String,List<String>> getAttributes()

      Specified by:
        `getAttributes` in interface `RoleModel`

    - #### isClientRole

          public boolean isClientRole()

      Specified by:
        `isClientRole` in interface `RoleModel`

    - #### getContainerId

          public String getContainerId()

      Specified by:
        `getContainerId` in interface `RoleModel`

    - #### getContainer

          public RoleContainerModel getContainer()

      Specified by:
        `getContainer` in interface `RoleModel`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2020 JBoss by Red Hat. All rights reserved.