Package io.github.astrapi69.model.mapper
Interface GenericModelMapper<ENTITY,DTO>
- Type Parameters:
ENTITY
- the element type of the entity objectDTO
- the generic type of the data transfer object
- All Superinterfaces:
io.github.astrapi69.bean.mapper.BeanMapper<ENTITY,
,DTO> io.github.astrapi69.bean.mapper.GenericMapper<ENTITY,
DTO, org.modelmapper.ModelMapper>
- All Known Implementing Classes:
AbstractGenericMapper
public interface GenericModelMapper<ENTITY,DTO>
extends io.github.astrapi69.bean.mapper.GenericMapper<ENTITY,DTO,org.modelmapper.ModelMapper>
The Interface
GenericModelMapper
provides the methods for mapping entities to data
transfer objects and back.-
Method Summary
Modifier and TypeMethodDescriptiondefault <D,
S> List<D> map
(Collection<S> sources, Class<D> destinationClass) Constructs new instances of destinationClass and performs mapping between from source.default <D,
S> D Constructs new instance of destinationClass and performs mapping between from source.default DTO
default ENTITY
Methods inherited from interface io.github.astrapi69.bean.mapper.BeanMapper
toDtos, toDtos, toEntities, toEntities
Methods inherited from interface io.github.astrapi69.bean.mapper.GenericMapper
getDtoClass, getEntityClass, getMapper, newMapper
-
Method Details
-
map
Constructs new instances of destinationClass and performs mapping between from source.- Specified by:
map
in interfaceio.github.astrapi69.bean.mapper.GenericMapper<ENTITY,
DTO, org.modelmapper.ModelMapper> - Type Parameters:
S
- the generic type of the sourceD
- the generic type of the destinationClass- Parameters:
sources
- the collection of source objectsdestinationClass
- the destination class- Returns:
- the new instance of destinationClass mapped to source object.
-
map
Constructs new instance of destinationClass and performs mapping between from source.- Specified by:
map
in interfaceio.github.astrapi69.bean.mapper.GenericMapper<ENTITY,
DTO, org.modelmapper.ModelMapper> - Type Parameters:
D
- the generic type of the destinationClassS
- the generic type of the source- Parameters:
source
- the sourcedestinationClass
- the destination class- Returns:
- the new instance of destinationClass mapped to source object.
-
toDto
-
toEntity
-