org.keycloak.models.utils

## Class RepresentationToModel

- java.lang.Object
- - org.keycloak.models.utils.RepresentationToModel

-     public class RepresentationToModel
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RepresentationToModel()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addRequiredCredential(RealmModel newRealm, String requiredCred)`
    `static UserCredentialModel` | `convertCredential(CredentialRepresentation cred)`
    `static ApplicationModel` | `createApplication(RealmModel realm, ApplicationRepresentation resourceRep, boolean addDefaultRoles)` Does not create scope or role mappings!
    `static void` | `createApplicationRoleMappings(ApplicationModel applicationModel, UserModel user, List<String> roleNames)`
    `static void` | `createApplicationScopeMappings(RealmModel realm, ApplicationModel applicationModel, List<ScopeMappingRepresentation> mappings)`
    `static OAuthClientModel` | `createOAuthClient(OAuthClientRepresentation rep, RealmModel realm)`
    `static OAuthClientModel` | `createOAuthClient(String id, String name, RealmModel realm)`
    `static void` | `createRole(RealmModel newRealm, RoleRepresentation roleRep)`
    `static UserModel` | `createUser(KeycloakSession session, RealmModel newRealm, UserRepresentation userRep, Map<String,ApplicationModel> appMap)`
    `static void` | `importRealm(KeycloakSession session, RealmRepresentation rep, RealmModel newRealm)`
    `static void` | `setClaims(ClientModel model, ClaimRepresentation rep)`
    `static void` | `updateApplication(ApplicationRepresentation rep, ApplicationModel resource)`
    `static void` | `updateOAuthClient(OAuthClientRepresentation rep, OAuthClientModel model)`
    `static void` | `updateRealm(RealmRepresentation rep, RealmModel realm)`

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

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

- - ### Constructor Detail

    - #### RepresentationToModel

          public RepresentationToModel()

  - ### Method Detail

    - #### importRealm

          public static void importRealm(KeycloakSession session,
                         RealmRepresentation rep,
                         RealmModel newRealm)

    - #### updateRealm

          public static void updateRealm(RealmRepresentation rep,
                         RealmModel realm)

    - #### addRequiredCredential

          public static void addRequiredCredential(RealmModel newRealm,
                                   String requiredCred)

    - #### createRole

          public static void createRole(RealmModel newRealm,
                        RoleRepresentation roleRep)

    - #### createApplication

          public static ApplicationModel createApplication(RealmModel realm,
                                           ApplicationRepresentation resourceRep,
                                           boolean addDefaultRoles)

      Does not create scope or role mappings!
      Parameters:
        `realm` -
        `resourceRep` -
      Returns:

    - #### updateApplication

          public static void updateApplication(ApplicationRepresentation rep,
                               ApplicationModel resource)

    - #### setClaims

          public static void setClaims(ClientModel model,
                       ClaimRepresentation rep)

    - #### createOAuthClient

          public static OAuthClientModel createOAuthClient(String id,
                                           String name,
                                           RealmModel realm)

    - #### createOAuthClient

          public static OAuthClientModel createOAuthClient(OAuthClientRepresentation rep,
                                           RealmModel realm)

    - #### updateOAuthClient

          public static void updateOAuthClient(OAuthClientRepresentation rep,
                               OAuthClientModel model)

    - #### createApplicationScopeMappings

          public static void createApplicationScopeMappings(RealmModel realm,
                                            ApplicationModel applicationModel,
                                            List<ScopeMappingRepresentation> mappings)

    - #### createUser

          public static UserModel createUser(KeycloakSession session,
                             RealmModel newRealm,
                             UserRepresentation userRep,
                             Map<String,ApplicationModel> appMap)

    - #### convertCredential

          public static UserCredentialModel convertCredential(CredentialRepresentation cred)

    - #### createApplicationRoleMappings

          public static void createApplicationRoleMappings(ApplicationModel applicationModel,
                                           UserModel user,
                                           List<String> roleNames)

Copyright © 2014. All Rights Reserved.