A - the aggregate rootD - the dto typepublic interface Assembler<A,D>
It provides two types of transformations:
FluentAssembler| Modifier and Type | Method and Description |
|---|---|
D |
assembleDtoFromAggregate(A sourceAggregate)
Creates a new DTO and assemble it from the aggregate.
|
void |
assembleDtoFromAggregate(D targetDto,
A sourceAggregate)
Updates an existing DTO with a source aggregate root.
|
Class<D> |
getDtoClass()
Returns the DTO type handled by the assembler.
|
void |
mergeAggregateWithDto(A targetAggregate,
D sourceDto)
Merges a source DTO into an existing aggregate root.
|
D assembleDtoFromAggregate(A sourceAggregate)
Equivalent of assembleDtoFromAggregate(new D(), sourceAggregate)
sourceAggregate - The source aggregatevoid assembleDtoFromAggregate(D targetDto, A sourceAggregate)
targetDto - The target dtosourceAggregate - The source aggregatevoid mergeAggregateWithDto(A targetAggregate, D sourceDto)
targetAggregate - The target aggregatesourceDto - The source dtoClass<D> getDtoClass()
This method is used by assembleDtoFromAggregate(Object)
to determine the DTO type to instantiate.
Copyright © 2013-2016–2016 SeedStack. All rights reserved.