org.keycloak.models.mongo.api.types

## Class MapperRegistry

- java.lang.Object
- - org.keycloak.models.mongo.api.types.MapperRegistry

-     public class MapperRegistry
      extends Object

  Registry of mappers, which allow to convert application object to database objects. MapperRegistry is main entry point to be used by application. Application can create instance of MapperRegistry and then register required Mapper objects.
  Author:
    Marek Posolda

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MapperRegistry()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAppObjectMapper(Mapper<?,?> mapper)` Add mapper for converting application objects to DB objects
    `void` | `addDBObjectMapper(Mapper<?,?> mapper)` Add mapper for converting DB objects to application objects
    `<S> S` | `convertApplicationObjectToDBObject(Object applicationObject, Class<S> expectedDBObjectType)`
    `<S> S` | `convertDBObjectToApplicationObject(MapperContext<Object,S> context)`

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

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

- - ### Constructor Detail

    - #### MapperRegistry

          public MapperRegistry()

  - ### Method Detail

    - #### addAppObjectMapper

          public void addAppObjectMapper(Mapper<?,?> mapper)

      Add mapper for converting application objects to DB objects
      Parameters:
        `mapper` -

    - #### addDBObjectMapper

          public void addDBObjectMapper(Mapper<?,?> mapper)

      Add mapper for converting DB objects to application objects
      Parameters:
        `mapper` -

    - #### convertDBObjectToApplicationObject

          public <S> S convertDBObjectToApplicationObject(MapperContext<Object,S> context)

    - #### convertApplicationObjectToDBObject

          public <S> S convertApplicationObjectToDBObject(Object applicationObject,
                                                 Class<S> expectedDBObjectType)

Copyright © 2014. All Rights Reserved.