Module bean.mapper.api
Package io.github.astrapi69.bean.mapper
Interface GenericMapper<ENTITY,DTO,MAPPER>
-
- Type Parameters:
ENTITY
- the element type of the entity objectDTO
- the generic type of the data transfer objectMAPPER
- the generic type of the mapper object
- All Superinterfaces:
BeanMapper<ENTITY,DTO>
public interface GenericMapper<ENTITY,DTO,MAPPER> extends BeanMapper<ENTITY,DTO>
The interfaceGenericMapper
extendsBeanMapper
provides methods for get the mapper, the class type of entity and the dto
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Class<DTO>
getDtoClass()
Gets the data transfer object class.java.lang.Class<ENTITY>
getEntityClass()
Gets the entity class.MAPPER
getMapper()
Gets the mapper<D,S>
java.util.Collection<D>map(java.util.Collection<S> sources, java.lang.Class<D> destinationClass)
Constructs new instances of destinationClass and performs mapping between from source.<D,S>
Dmap(S source, java.lang.Class<D> destinationClass)
Constructs new instance of destinationClass and performs mapping between from source.-
Methods inherited from interface io.github.astrapi69.bean.mapper.BeanMapper
toDto, toDtos, toDtos, toEntities, toEntities, toEntity
-
-
-
-
Method Detail
-
getMapper
MAPPER getMapper()
Gets the mapper- Returns:
- the mapper
-
getDtoClass
java.lang.Class<DTO> getDtoClass()
Gets the data transfer object class.- Returns:
- the data transfer object class
-
getEntityClass
java.lang.Class<ENTITY> getEntityClass()
Gets the entity class.- Returns:
- the entity class
-
map
<D,S> java.util.Collection<D> map(java.util.Collection<S> sources, java.lang.Class<D> destinationClass)
Constructs new instances of destinationClass and performs mapping between from source.- 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
<D,S> D map(S source, java.lang.Class<D> destinationClass)
Constructs new instance of destinationClass and performs mapping between from source.- Type Parameters:
S
- the generic type of the sourceD
- the generic type of the destinationClass- Parameters:
source
- the sourcedestinationClass
- the destination class- Returns:
- the new instance of destinationClass mapped to source object.
-
-