Class SimpleMapperRegistry
java.lang.Object
dev.getelements.elements.sdk.model.util.SimpleMapperRegistry
- All Implemented Interfaces:
MapperRegistry
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents a key for aMapperRegistry.Mapperor anMapperRegistry.UpdaterNested classes/interfaces inherited from interface dev.getelements.elements.sdk.model.util.MapperRegistry
MapperRegistry.Mapper<SourceT,DestinationT>, MapperRegistry.ReversibleMapper<SourceT, DestinationT>, MapperRegistry.ReversibleUpdater<SourceT, DestinationT>, MapperRegistry.Updater<SourceT, DestinationT> -
Constructor Summary
ConstructorsConstructorDescriptionSimpleMapperRegistry(Map<SimpleMapperRegistry.MappingKey, MapperRegistry.Mapper<?, ?>> mapperMap, Map<SimpleMapperRegistry.MappingKey, MapperRegistry.Updater<?, ?>> updatermap) -
Method Summary
Modifier and TypeMethodDescription<SourceT,DestinationT>
Optional<MapperRegistry.Mapper<SourceT, DestinationT>> findMapper(Class<SourceT> source, Class<DestinationT> destination) Finds aMapperRegistry.Mapper.<SourceT,DestinationT>
Optional<MapperRegistry.Updater<SourceT, DestinationT>> findUpdater(Class<SourceT> source, Class<DestinationT> destination) Finds anMapperRegistry.Updater.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.getelements.elements.sdk.model.util.MapperRegistry
getMapper, getUpdater, map, map
-
Constructor Details
-
SimpleMapperRegistry
public SimpleMapperRegistry(Map<SimpleMapperRegistry.MappingKey, MapperRegistry.Mapper<?, ?>> mapperMap, Map<SimpleMapperRegistry.MappingKey, MapperRegistry.Updater<?, ?>> updatermap)
-
-
Method Details
-
findMapper
public <SourceT,DestinationT> Optional<MapperRegistry.Mapper<SourceT,DestinationT>> findMapper(Class<SourceT> source, Class<DestinationT> destination) Description copied from interface:MapperRegistryFinds aMapperRegistry.Mapper. ThrowingMapperExceptionin the event the mapping isn't found.- Specified by:
findMapperin interfaceMapperRegistry- Type Parameters:
SourceT- the source typeDestinationT- the destination type- Parameters:
source- the source typedestination- the destination type- Returns:
- the
MapperRegistry.Mapper
-
findUpdater
public <SourceT,DestinationT> Optional<MapperRegistry.Updater<SourceT,DestinationT>> findUpdater(Class<SourceT> source, Class<DestinationT> destination) Description copied from interface:MapperRegistryFinds anMapperRegistry.Updater. ThrowingMapperExceptionin the event the mapping isn't found.- Specified by:
findUpdaterin interfaceMapperRegistry- Type Parameters:
SourceT- the source typeDestinationT- the destination type- Parameters:
source- the source typedestination- the destination type- Returns:
- the
MapperRegistry.Mapper
-