A
- the type of the aggregate root or of the Tuple
of aggregate
roots.D
- the type of the DTO.public interface Assembler<A,D>
FluentAssembler
DSL to execute complex mapping tasks.FluentAssembler
Modifier and Type | Method and Description |
---|---|
D |
createDto()
This method is responsible for creating a new DTO instance during the assembling task.
|
default D |
createDtoFromAggregate(A sourceAggregate)
Creates a new DTO and merge the given aggregate into it.
|
Class<D> |
getDtoClass()
The DTO class the assemblers works on.
|
void |
mergeAggregateIntoDto(A sourceAggregate,
D targetDto)
Merge a source aggregate into an existing target DTO.
|
void |
mergeDtoIntoAggregate(D sourceDto,
A targetAggregate)
Merges a source DTO into an existing target aggregate root.
|
default D createDtoFromAggregate(A sourceAggregate)
createDto()
is called
to create the DTO instance, then mergeAggregateIntoDto(Object, Object)
is called to do
the merge.sourceAggregate
- the source aggregate.void mergeAggregateIntoDto(A sourceAggregate, D targetDto)
sourceAggregate
- the source aggregate.targetDto
- the target dto.void mergeDtoIntoAggregate(D sourceDto, A targetAggregate)
sourceDto
- the source dto.targetAggregate
- the target aggregate.D createDto()
createDtoFromAggregate(Object)
Copyright © 2013-2018–2019 SeedStack. All rights reserved.