Class SimpleMapperRegistry
java.lang.Object
dev.getelements.elements.sdk.model.util.SimpleMapperRegistry
- All Implemented Interfaces:
MapperRegistry
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
Represents a key for aMapperRegistry.Mapper
or anMapperRegistry.Updater
Nested 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
.Stream
<MapperRegistry.Mapper<?, ?>> mappers()
Gets all the mappers registered in this registry.Stream
<MapperRegistry.Updater<?, ?>> updaters()
Gets all the updaters registered in this registry.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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
-
mappers
Description copied from interface:MapperRegistry
Gets all the mappers registered in this registry.- Specified by:
mappers
in interfaceMapperRegistry
- Returns:
- all mappers
-
updaters
Description copied from interface:MapperRegistry
Gets all the updaters registered in this registry.- Specified by:
updaters
in interfaceMapperRegistry
- Returns:
- all updaters
-
findMapper
public <SourceT,DestinationT> Optional<MapperRegistry.Mapper<SourceT,DestinationT>> findMapper(Class<SourceT> source, Class<DestinationT> destination) Description copied from interface:MapperRegistry
Finds aMapperRegistry.Mapper
. ThrowingMapperException
in the event the mapping isn't found.- Specified by:
findMapper
in 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:MapperRegistry
Finds anMapperRegistry.Updater
. ThrowingMapperException
in the event the mapping isn't found.- Specified by:
findUpdater
in interfaceMapperRegistry
- Type Parameters:
SourceT
- the source typeDestinationT
- the destination type- Parameters:
source
- the source typedestination
- the destination type- Returns:
- the
MapperRegistry.Mapper
-