org.keycloak.models.map.role

## Class MapRoleAdapter

- java.lang.Object
- - org.keycloak.models.map.role.AbstractRoleModel<MapRoleEntity>
  - - org.keycloak.models.map.role.MapRoleAdapter

- All Implemented Interfaces:
    RoleModel

      public class MapRoleAdapter
      extends AbstractRoleModel<MapRoleEntity>
      implements RoleModel

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.keycloak.models.RoleModel

      `RoleModel.SearchableFields`

  - ### Field Summary

    - ### Fields inherited from class org.keycloak.models.map.role.AbstractRoleModel

      `entity, realm, session`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MapRoleAdapter(KeycloakSession session, RealmModel realm, MapRoleEntity entity)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCompositeRole(RoleModel role)`
    `Map<String,List<String>>` | `getAttributes()`
    `Stream<String>` | `getAttributeStream(String name)` Returns all role's attributes that match the given name as a stream.
    `Stream<RoleModel>` | `getCompositesStream()` Returns all composite roles as a stream.
    `RoleContainerModel` | `getContainer()`
    `String` | `getContainerId()`
    `String` | `getDescription()`
    `String` | `getId()`
    `String` | `getName()`
    `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` | `setSingleAttribute(String name, String value)`
    `String` | `toString()`

    - ### Methods inherited from class org.keycloak.models.map.role.AbstractRoleModel

      `equals, hashCode`

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

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

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

      `getAttribute, getComposites, getFirstAttribute`

- - ### Constructor Detail

    - #### MapRoleAdapter

          public MapRoleAdapter(KeycloakSession session,
                                RealmModel realm,
                                MapRoleEntity entity)

  - ### Method Detail

    - #### getId

          public String getId()

      Specified by:
        `getId` in interface `RoleModel`

    - #### 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`

    - #### setName

          public void setName(String name)

      Specified by:
        `setName` in interface `RoleModel`

    - #### isComposite

          public boolean isComposite()

      Specified by:
        `isComposite` in interface `RoleModel`

    - #### getCompositesStream

          public Stream<RoleModel> getCompositesStream()

      Description copied from interface: `RoleModel`
      Returns all composite roles as a stream.
      Specified by:
        `getCompositesStream` in interface `RoleModel`
      Returns:
        Stream of `RoleModel`. Never returns `null`.

    - #### addCompositeRole

          public void addCompositeRole(RoleModel role)

      Specified by:
        `addCompositeRole` in interface `RoleModel`

    - #### removeCompositeRole

          public void removeCompositeRole(RoleModel role)

      Specified by:
        `removeCompositeRole` 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`

    - #### setAttribute

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

      Specified by:
        `setAttribute` in interface `RoleModel`

    - #### setSingleAttribute

          public void setSingleAttribute(String name,
                                         String value)

      Specified by:
        `setSingleAttribute` in interface `RoleModel`

    - #### removeAttribute

          public void removeAttribute(String name)

      Specified by:
        `removeAttribute` in interface `RoleModel`

    - #### getAttributes

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

      Specified by:
        `getAttributes` in interface `RoleModel`

    - #### hasRole

          public boolean hasRole(RoleModel role)

      Specified by:
        `hasRole` in interface `RoleModel`

    - #### getAttributeStream

          public Stream<String> getAttributeStream(String name)

      Description copied from interface: `RoleModel`
      Returns all role's attributes that match the given name as a stream.
      Specified by:
        `getAttributeStream` in interface `RoleModel`
      Parameters:
        `name` - `String` Name of an attribute to be used as a filter.
      Returns:
        Stream of `String`. Never returns `null`.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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