Package io.github.astrapi69.model.mapper
Class ModelMapperExtensions
java.lang.Object
io.github.astrapi69.model.mapper.ModelMapperExtensions
The class
ModelMapperExtensions
provides methods for map from source to a destination
class-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T,
S> List<T> Constructs new instances of destinationClass and performs mapping between from source to destination classstatic <T,
S> List<T> map
(org.modelmapper.ModelMapper mapper, Collection<S> sources, Class<T> destinationClass) Constructs new instances of destinationClass and performs mapping between from source to destination classstatic <T,
S> T Constructs new instance of destinationClass and performs mapping between from source to destination class
-
Constructor Details
-
ModelMapperExtensions
public ModelMapperExtensions()
-
-
Method Details
-
map
public static <T,S> List<T> map(org.modelmapper.ModelMapper mapper, Collection<S> sources, Class<T> destinationClass) Constructs new instances of destinationClass and performs mapping between from source to destination class- Type Parameters:
T
- the generic type of the destinationClassS
- the generic type of the source- Parameters:
mapper
- the dozer mapper objectsources
- the collection of source objectsdestinationClass
- the destination class- Returns:
- the new instance of destinationClass mapped to source object.
-
map
public static <T,S> List<T> map(org.modelmapper.ModelMapper mapper, Iterable<S> sources, Class<T> destinationClass) Constructs new instances of destinationClass and performs mapping between from source to destination class- Type Parameters:
T
- the generic type of the destinationClassS
- the generic type of the source- Parameters:
mapper
- the dozer mapper objectsources
- the iterable 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 to destination class- Type Parameters:
T
- the generic type of the destinationClassS
- the generic type of the source- Parameters:
mapper
- the dozer mapper objectsource
- the sourcedestinationClass
- the destination class- Returns:
- the new instance of destinationClass mapped to source object.
-