public interface DtoInfoResolver
FluentAssembler
to create domain aggregates and/or identifiers from DTO instances.
There can be several DtoInfoResolver
s in the system: the first one returning true
from the supports(Object)
for a particular DTO will be used. Implementations can be
annotated with javax.annotation.Priority
to define an absolute order amongst them.
Modifier and Type | Method and Description |
---|---|
<D,A extends AggregateRoot<?>> |
resolveAggregate(D dto,
Class<A> aggregateRootClass)
Returns the aggregate instance derived from the DTO instance passed as first argument.
|
<D,A extends AggregateRoot<?>> |
resolveAggregate(D dto,
Class<A> aggregateRootClass,
int position)
Similar to
resolveAggregate(Object, Class) but used in the case where a Tuple of multiple aggregates corresponds to a single DTO. |
<D,I> I |
resolveId(D dto,
Class<I> aggregateIdClass)
Returns the identifier instance derived from the DTO instance passed as first argument.
|
<D,I> I |
resolveId(D dto,
Class<I> aggregateIdClass,
int position)
Similar to
resolveId(Object, Class) but used in the case where a Tuple of multiple aggregates corresponds to a single DTO. |
<D> boolean |
supports(D dto)
Returns whether the resolver supports the DTO instance passed as argument.
|
<D> boolean supports(D dto)
D
- the type of the DTO.dto
- the DTO to check for.<D,I> I resolveId(D dto, Class<I> aggregateIdClass)
D
- the type of the DTO.I
- the type of the identifier.dto
- the DTO used to resolve the identifier.aggregateIdClass
- the identifier class.<D,I> I resolveId(D dto, Class<I> aggregateIdClass, int position)
resolveId(Object, Class)
but used in the case where a Tuple
of multiple aggregates corresponds to a single DTO. The position argument
specifies the index of the identifier in the tuple.D
- the type of the DTO.I
- the type of the identifier.dto
- the DTO used to resolve the identifier.aggregateIdClass
- the identifier class.position
- the position in the tuple of the aggregate this identifier relates to.<D,A extends AggregateRoot<?>> A resolveAggregate(D dto, Class<A> aggregateRootClass)
D
- the type of the DTO.A
- the type of the aggregate root.dto
- the DTO sued to resolve the aggregate.aggregateRootClass
- the aggregate root class.<D,A extends AggregateRoot<?>> A resolveAggregate(D dto, Class<A> aggregateRootClass, int position)
resolveAggregate(Object, Class)
but used in the case where a Tuple
of multiple aggregates corresponds to a single DTO. The position argument
specifies the index of the aggregate in the tuple.D
- the type of the DTO.A
- the type of the aggregate root.dto
- the DTO sued to resolve the aggregate.aggregateRootClass
- the aggregate root class.position
- the position in the tuple of the aggregate to create.Copyright © 2013-2018–2019 SeedStack. All rights reserved.