T - the type of the tuple.D - the type of the DTO.public abstract class ModelMapperTupleAssembler<T extends org.javatuples.Tuple,D> extends BaseTupleAssembler<T,D>
ModelMapper instance.| Modifier | Constructor and Description |
|---|---|
|
ModelMapperTupleAssembler() |
protected |
ModelMapperTupleAssembler(Class<D> dtoClass) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
configure(org.modelmapper.ModelMapper modelMapper)
This method is called once when the first mapping of the assembler occurs.
|
D |
createDtoFromAggregate(T sourceAggregate)
Creates a new DTO and merge the given aggregate into it.
|
void |
mergeAggregateIntoDto(T sourceAggregate,
D targetDto)
Merge a source aggregate into an existing target DTO.
|
void |
mergeDtoIntoAggregate(D sourceDto,
T targetAggregate)
Merges a source DTO into an existing target aggregate root.
|
createDto, getDtoClasspublic D createDtoFromAggregate(T sourceAggregate)
AssemblerAssembler.createDto() is called
to create the DTO instance, then Assembler.mergeAggregateIntoDto(Object, Object) is called to do
the merge.sourceAggregate - the source aggregate.public void mergeAggregateIntoDto(T sourceAggregate, D targetDto)
AssemblersourceAggregate - the source aggregate.targetDto - the target dto.public void mergeDtoIntoAggregate(D sourceDto, T targetAggregate)
AssemblersourceDto - the source dto.targetAggregate - the target aggregate.protected abstract void configure(org.modelmapper.ModelMapper modelMapper)
ModelMapper instance that will be used for mapping. This instance will then be reused for subsequent
calls.modelMapper - the ModelMapper instance to configure.Copyright © 2013-2018–2019 SeedStack. All rights reserved.