org.keycloak.models.mongo.keycloak.adapters

## Class RoleAdapter

- java.lang.Object
- - org.keycloak.models.mongo.keycloak.adapters.AbstractMongoAdapter<MongoRoleEntity>
  - - org.keycloak.models.mongo.keycloak.adapters.RoleAdapter

- All Implemented Interfaces:
    RoleModel

      public class RoleAdapter
      extends AbstractMongoAdapter<MongoRoleEntity>
      implements RoleModel

  Wrapper around RoleData object, which will persist wrapped object after each set operation (compatibility with picketlink based idm)
  Author:
    Marek Posolda

- - ### Field Summary

    - ### Fields inherited from class org.keycloak.models.mongo.keycloak.adapters.AbstractMongoAdapter

      `invocationContext`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RoleAdapter(KeycloakSession session, RealmModel realm, MongoRoleEntity roleEntity, MongoStoreInvocationContext invContext)`
    `RoleAdapter(KeycloakSession session, RealmModel realm, MongoRoleEntity roleEntity, RoleContainerModel roleContainer, MongoStoreInvocationContext invContext)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCompositeRole(RoleModel childRole)`
    `boolean` | `equals(Object o)`
    `Set<RoleModel>` | `getComposites()`
    `RoleContainerModel` | `getContainer()`
    `String` | `getDescription()`
    `String` | `getId()`
    `MongoRoleEntity` | `getMongoEntity()`
    `String` | `getName()`
    `MongoRoleEntity` | `getRole()`
    `int` | `hashCode()`
    `boolean` | `hasRole(RoleModel role)`
    `boolean` | `isComposite()`
    `void` | `removeCompositeRole(RoleModel childRole)`
    `void` | `setDescription(String description)`
    `void` | `setName(String name)`
    `protected void` | `updateRole()`

    - ### Methods inherited from class org.keycloak.models.mongo.keycloak.adapters.AbstractMongoAdapter

      `getMongoStore, updateMongoEntity`

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

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

- - ### Constructor Detail

    - #### RoleAdapter

          public RoleAdapter(KeycloakSession session,
                     RealmModel realm,
                     MongoRoleEntity roleEntity,
                     MongoStoreInvocationContext invContext)

    - #### RoleAdapter

          public RoleAdapter(KeycloakSession session,
                     RealmModel realm,
                     MongoRoleEntity roleEntity,
                     RoleContainerModel roleContainer,
                     MongoStoreInvocationContext invContext)

  - ### Method Detail

    - #### getId

          public String getId()

      Specified by:
        `getId` in interface `RoleModel`

    - #### getName

          public String getName()

      Specified by:
        `getName` in interface `RoleModel`

    - #### setName

          public void setName(String name)

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

    - #### isComposite

          public boolean isComposite()

      Specified by:
        `isComposite` in interface `RoleModel`

    - #### updateRole

          protected void updateRole()

    - #### addCompositeRole

          public void addCompositeRole(RoleModel childRole)

      Specified by:
        `addCompositeRole` in interface `RoleModel`

    - #### removeCompositeRole

          public void removeCompositeRole(RoleModel childRole)

      Specified by:
        `removeCompositeRole` in interface `RoleModel`

    - #### getComposites

          public Set<RoleModel> getComposites()

      Specified by:
        `getComposites` in interface `RoleModel`

    - #### getContainer

          public RoleContainerModel getContainer()

      Specified by:
        `getContainer` in interface `RoleModel`

    - #### hasRole

          public boolean hasRole(RoleModel role)

      Specified by:
        `hasRole` in interface `RoleModel`

    - #### getRole

          public MongoRoleEntity getRole()

    - #### getMongoEntity

          public MongoRoleEntity getMongoEntity()

      Specified by:
        `getMongoEntity` in class `AbstractMongoAdapter<MongoRoleEntity>`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `AbstractMongoAdapter<MongoRoleEntity>`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `AbstractMongoAdapter<MongoRoleEntity>`

Copyright © 2014. All Rights Reserved.