Interface FluentAssembler
-
public interface FluentAssemblerFluentAssembler is a DSL aimed at automating the most frequent tasks that occurs when mapping aggregates to Data Transfer Objects (DTO) and back. It works seamlessly on individual objects,Streams,Iterables, andPages. It also works with tuples of aggregates.When merging a DTO back into aggregate(s), FluentAssembler can use a
Repositoryand/or aFactoryto obtain the aggregate(s).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <A extends AggregateRoot<I>,I>
AssembleSingleWithQualifierassemble(A aggregateRoot)Assembles an aggregate.<A extends AggregateRoot<I>,I>
AssembleMultipleWithQualifierassemble(Iterable<A> iterable)Assembles an iterable of aggregates.<A extends AggregateRoot<I>,I>
AssembleMultipleWithQualifierassemble(Stream<A> stream)Assembles a stream of aggregates.<A extends AggregateRoot<I>,I>
AssemblePageWithQualifierassemble(Page<A> page)Assembles a page of aggregates.<T extends org.javatuples.Tuple>
AssembleSingleWithQualifierassembleTuple(T tuple)Assembles a tuple of aggregates into a single DTO.<T extends org.javatuples.Tuple>
AssembleMultipleWithQualifierassembleTuples(Iterable<T> iterable)Assembles an iterable of tuple of aggregates.<T extends org.javatuples.Tuple>
AssembleMultipleWithQualifierassembleTuples(Stream<T> stream)Assembles a stream of tuple of aggregates.<T extends org.javatuples.Tuple>
AssemblePageWithQualifierassembleTuples(Page<T> page)Assembles a page of tuple of aggregates.<D> MergeSingleWithQualifiermerge(D dto)Merges a DTO back into an aggregate.<D> MergeMultipleWithQualifiermerge(Iterable<D> iterable)Merges an iterable of DTO back into aggregates.<D> MergeMultipleWithQualifiermerge(Stream<D> stream)Merges a stream of DTO back into aggregates.
-
-
-
Method Detail
-
assemble
<A extends AggregateRoot<I>,I> AssembleSingleWithQualifier assemble(A aggregateRoot)
Assembles an aggregate.- Type Parameters:
A- the type of the aggregate root.I- the type of the aggregate root identifier.- Parameters:
aggregateRoot- the aggregate root to assemble.- Returns:
- the next type for FluentAssembler DSL.
-
assemble
<A extends AggregateRoot<I>,I> AssembleMultipleWithQualifier assemble(Stream<A> stream)
Assembles a stream of aggregates.- Type Parameters:
A- the type of the aggregate root.I- the type of the aggregate root identifier.- Parameters:
stream- the stream of aggregate roots to assemble.- Returns:
- the next type for FluentAssembler DSL.
-
assemble
<A extends AggregateRoot<I>,I> AssembleMultipleWithQualifier assemble(Iterable<A> iterable)
Assembles an iterable of aggregates.- Type Parameters:
A- the type of the aggregate root.I- the type of the aggregate root identifier.- Parameters:
iterable- the iterable of aggregate roots to assemble.- Returns:
- the next type for FluentAssembler DSL.
-
assemble
<A extends AggregateRoot<I>,I> AssemblePageWithQualifier assemble(Page<A> page)
Assembles a page of aggregates.- Type Parameters:
A- the type of the aggregate root.I- the type of the aggregate root identifier.- Parameters:
page- the page of aggregate roots to assemble.- Returns:
- the next type for FluentAssembler DSL.
-
assembleTuple
<T extends org.javatuples.Tuple> AssembleSingleWithQualifier assembleTuple(T tuple)
Assembles a tuple of aggregates into a single DTO.- Type Parameters:
T- the type of the tuple.- Parameters:
tuple- the tuple of aggregate roots to assemble.- Returns:
- the next type for FluentAssembler DSL.
-
assembleTuples
<T extends org.javatuples.Tuple> AssembleMultipleWithQualifier assembleTuples(Stream<T> stream)
Assembles a stream of tuple of aggregates.- Type Parameters:
T- the type of the tuple.- Parameters:
stream- the stream of tuples of aggregate roots to assemble.- Returns:
- the next type for FluentAssembler DSL.
-
assembleTuples
<T extends org.javatuples.Tuple> AssembleMultipleWithQualifier assembleTuples(Iterable<T> iterable)
Assembles an iterable of tuple of aggregates.- Type Parameters:
T- the type of the tuple.- Parameters:
iterable- the iterable of tuples of aggregate roots to assemble.- Returns:
- the next type for FluentAssembler DSL.
-
assembleTuples
<T extends org.javatuples.Tuple> AssemblePageWithQualifier assembleTuples(Page<T> page)
Assembles a page of tuple of aggregates.- Type Parameters:
T- the type of the tuple.- Parameters:
page- the page of tuples of aggregate roots to assemble.- Returns:
- the next type for FluentAssembler DSL.
-
merge
<D> MergeSingleWithQualifier merge(D dto)
Merges a DTO back into an aggregate.- Type Parameters:
D- the DTO type.- Parameters:
dto- the dto to merge- Returns:
- the next type for FluentAssembler DSL.
-
merge
<D> MergeMultipleWithQualifier merge(Stream<D> stream)
Merges a stream of DTO back into aggregates.- Type Parameters:
D- the DTO type.- Parameters:
stream- the stream of DTO.- Returns:
- the next type for FluentAssembler DSL.
-
merge
<D> MergeMultipleWithQualifier merge(Iterable<D> iterable)
Merges an iterable of DTO back into aggregates.- Type Parameters:
D- the DTO type.- Parameters:
iterable- the iterable of DTO.- Returns:
- the next type for FluentAssembler DSL.
-
-