- All Superinterfaces:
Mappers
,RuntimeType.Api<MappersConfig>
Deprecated, for removal: This API element is subject to removal in a future version.
Mapper manager of all configured mappers.
To map a source to target, you can use either of the map
methods defined in this interface,
as they make sure that the mapping exists in either space.
- If you call
map(Object, Class, Class, String...)
and no mapper is found for the class pair, the implementation calls themap(Object, io.helidon.common.GenericType, io.helidon.common.GenericType, String...)
withGenericType
s created for each parameters - If you call
map(Object, io.helidon.common.GenericType, io.helidon.common.GenericType, String...)
and no mapper is found for theGenericType
pair, an attempt is to locate a mapper for the underlying class *IF* the generic type represents a simple class (e.g. not a generic type declaration)
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class
Deprecated, for removal: This API element is subject to removal in a future version.useMappersConfig.Builder
, obtained fromMappers.builder()
-
Method Summary
Modifier and TypeMethodDescriptionstatic MapperManager.Builder
builder()
Deprecated, for removal: This API element is subject to removal in a future version.useMappers.builder()
insteadstatic MapperManager
create()
Deprecated, for removal: This API element is subject to removal in a future version.useMappers.create()
insteadstatic MapperManager
global()
Deprecated, for removal: This API element is subject to removal in a future version.useServices.get(Class)
- i.e.static void
global
(MapperManager manager) Deprecated, for removal: This API element is subject to removal in a future version.useServices.set(Class, Object[])
- i.e.<SOURCE,
TARGET>
TARGETmap
(SOURCE source, GenericType<SOURCE> sourceType, GenericType<TARGET> targetType, String... qualifiers) Deprecated, for removal: This API element is subject to removal in a future version.Map from source to target.<SOURCE,
TARGET>
TARGETDeprecated, for removal: This API element is subject to removal in a future version.Map from source to target.mapper
(GenericType<SOURCE> sourceType, GenericType<TARGET> targetType, String... qualifiers) Deprecated, for removal: This API element is subject to removal in a future version.Obtain a mapper for the provided types and qualifiers.Methods inherited from interface io.helidon.builder.api.RuntimeType.Api
prototype
-
Method Details
-
global
Deprecated, for removal: This API element is subject to removal in a future version.useServices.get(Class)
- i.e.Services.get(Mappers.class)
, or use your registry instance in a similar wayGet an instance of the configured global manager. If none is explicitly set, an instance is created using discovered and built-in mappers.- Returns:
- global mapper manager
-
global
Deprecated, for removal: This API element is subject to removal in a future version.useServices.set(Class, Object[])
- i.e.Services.get(Mappers.class, myMappers)
before the program starts (must be configured before it is first used)Configure a new global mapper manager.- Parameters:
manager
- mapper manager to use
-
builder
Deprecated, for removal: This API element is subject to removal in a future version.useMappers.builder()
insteadCreate a fluent API builder to create a customized mapper manager.- Returns:
- a new builder
-
create
Deprecated, for removal: This API element is subject to removal in a future version.useMappers.create()
insteadCreate a mapper manager using only Java Service loader loadedMapperProviders
.- Returns:
- create a new mapper manager from service loader
-
map
<SOURCE,TARGET> TARGET map(SOURCE source, GenericType<SOURCE> sourceType, GenericType<TARGET> targetType, String... qualifiers) throws MapperException Deprecated, for removal: This API element is subject to removal in a future version.Map from source to target.- Specified by:
map
in interfaceMappers
- Type Parameters:
SOURCE
- type of the sourceTARGET
- type of the target- Parameters:
source
- object to mapsourceType
- type of the source object (to locate the mapper)targetType
- type of the target object (to locate the mapper)qualifiers
- qualifiers of the usage (such ashttp-headers, http
, most specific one first)- Returns:
- result of the mapping
- Throws:
MapperException
- in case the mapper was not found or failed
-
map
<SOURCE,TARGET> TARGET map(SOURCE source, Class<SOURCE> sourceType, Class<TARGET> targetType, String... qualifiers) throws MapperException Deprecated, for removal: This API element is subject to removal in a future version.Map from source to target.- Specified by:
map
in interfaceMappers
- Type Parameters:
SOURCE
- type of the sourceTARGET
- type of the target- Parameters:
source
- object to mapsourceType
- class of the source object (to locate the mapper)targetType
- class of the target object (to locate the mapper)qualifiers
- qualifiers of the usage (such ashttp-headers, http
, most specific one first)- Returns:
- result of the mapping
- Throws:
MapperException
- in case the mapper was not found or failed
-
mapper
<SOURCE,TARGET> Optional<Mapper<SOURCE,TARGET>> mapper(GenericType<SOURCE> sourceType, GenericType<TARGET> targetType, String... qualifiers) Deprecated, for removal: This API element is subject to removal in a future version.Obtain a mapper for the provided types and qualifiers.
-
Mappers
instead