Interface FluentAssembler


  • public interface FluentAssembler
    FluentAssembler 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, and Pages. It also works with tuples of aggregates.

    When merging a DTO back into aggregate(s), FluentAssembler can use a Repository and/or a Factory to obtain the aggregate(s).

    • 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.