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 InterfaceGenericModelMapper
provides the methods for mapping entities to data transfer objects and back.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default <D,S>
java.util.List<D>map(java.util.Collection<S> sources, java.lang.Class<D> destinationClass)
Constructs new instances of destinationClass and performs mapping between from source.default <D,S>
Dmap(S source, java.lang.Class<D> destinationClass)
Constructs new instance of destinationClass and performs mapping between from source.default DTO
toDto(ENTITY entity)
default ENTITY
toEntity(DTO dto)
-
-
-
Method Detail
-
map
default <D,S> java.util.List<D> map(java.util.Collection<S> sources, java.lang.Class<D> destinationClass)
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
default <D,S> D map(S source, java.lang.Class<D> destinationClass)
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.
-
-