org.keycloak.models

## Interface RoleModel

- All Known Implementing Classes:
    AbstractRoleModel, MapRoleAdapter, RoleAdapter, RoleAdapter

      public interface RoleModel

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `RoleModel.SearchableFields`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCompositeRole(RoleModel role)`
    `default List<String>` | `getAttribute(String name)` Deprecated. Use `getAttributeStream` instead.
    `Map<String,List<String>>` | `getAttributes()`
    `Stream<String>` | `getAttributeStream(String name)` Returns all role's attributes that match the given name as a stream.
    `default Set<RoleModel>` | `getComposites()` Deprecated. Use `getCompositesStream` instead.
    `Stream<RoleModel>` | `getCompositesStream()` Returns all composite roles as a stream.
    `RoleContainerModel` | `getContainer()`
    `String` | `getContainerId()`
    `String` | `getDescription()`
    `default String` | `getFirstAttribute(String name)`
    `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)`

- - ### Method Detail

    - #### getName

          String getName()

    - #### getDescription

          String getDescription()

    - #### setDescription

          void setDescription(String description)

    - #### getId

          String getId()

    - #### setName

          void setName(String name)

    - #### isComposite

          boolean isComposite()

    - #### addCompositeRole

          void addCompositeRole(RoleModel role)

    - #### removeCompositeRole

          void removeCompositeRole(RoleModel role)

    - #### getComposites

          @Deprecated
          default Set<RoleModel> getComposites()

      Deprecated. Use `getCompositesStream` instead.

    - #### getCompositesStream

          Stream<RoleModel> getCompositesStream()

      Returns all composite roles as a stream.
      Returns:
        Stream of `RoleModel`. Never returns `null`.

    - #### isClientRole

          boolean isClientRole()

    - #### getContainerId

          String getContainerId()

    - #### getContainer

          RoleContainerModel getContainer()

    - #### hasRole

          boolean hasRole(RoleModel role)

    - #### setSingleAttribute

          void setSingleAttribute(String name,
                                  String value)

    - #### setAttribute

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

    - #### removeAttribute

          void removeAttribute(String name)

    - #### getFirstAttribute

          default String getFirstAttribute(String name)

    - #### getAttribute

          @Deprecated
          default List<String> getAttribute(String name)

      Deprecated. Use `getAttributeStream` instead.

    - #### getAttributeStream

          Stream<String> getAttributeStream(String name)

      Returns all role's attributes that match the given name as a stream.
      Parameters:
        `name` - `String` Name of an attribute to be used as a filter.
      Returns:
        Stream of `String`. Never returns `null`.

    - #### getAttributes

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

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