Package com.github.dozermapper.core
Interface Mapper
-
- All Known Implementing Classes:
DozerBeanMapper,MappingProcessor
public interface MapperPublic root interface for performing Dozer mappings from application code.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description MapperModelContextgetMapperModelContext()ReturnsMapperModelContextwhich allows readonly access to the Mapper modeldefault MappingMetadatagetMappingMetadata()TheMappingMetadatainterface can be used to query information about the current mapping definitions.<T> Tmap(Object source, Class<T> destinationClass)Constructs new instance of destinationClass and performs mapping between from source<T> Tmap(Object source, Class<T> destinationClass, String mapId)Constructs new instance of destinationClass and performs mapping between from sourcevoidmap(Object source, Object destination)Performs mapping between source and destination objectsvoidmap(Object source, Object destination, String mapId)Performs mapping between source and destination objects
-
-
-
Method Detail
-
map
<T> T map(Object source, Class<T> destinationClass) throws MappingException
Constructs new instance of destinationClass and performs mapping between from source- Type Parameters:
T- type to convert to- Parameters:
source- object to convert fromdestinationClass- type to convert to- Returns:
- mapped object
- Throws:
MappingException- mapping failure
-
map
void map(Object source, Object destination) throws MappingException
Performs mapping between source and destination objects- Parameters:
source- object to convert fromdestination- object to convert to- Throws:
MappingException- mapping failure
-
map
<T> T map(Object source, Class<T> destinationClass, String mapId) throws MappingException
Constructs new instance of destinationClass and performs mapping between from source- Type Parameters:
T- type to convert to- Parameters:
source- object to convert fromdestinationClass- type to convert tomapId- id in configuration for mapping- Returns:
- mapped object
- Throws:
MappingException- mapping failure
-
map
void map(Object source, Object destination, String mapId) throws MappingException
Performs mapping between source and destination objects- Parameters:
source- object to convert fromdestination- object to convert tomapId- id in configuration for mapping- Throws:
MappingException- mapping failure
-
getMappingMetadata
default MappingMetadata getMappingMetadata()
TheMappingMetadatainterface can be used to query information about the current mapping definitions. It provides read only access to all important classes and field mapping properties. When first called, initializes all mappings if map() has not yet been called.- Returns:
- An instance of
MappingMetadatawhich serves starting point for querying mapping information.
-
getMapperModelContext
MapperModelContext getMapperModelContext()
ReturnsMapperModelContextwhich allows readonly access to the Mapper model- Returns:
- an instance of
MapperModelContext
-
-