Package io.github.pellse.assembler
Interface Assembler<T,RC>
-
- Type Parameters:
T- Type for Top Level Entity e.g.CustomerRC- Output Type e.g.Stream<Transaction>orFlux<Transaction>
- All Known Implementing Classes:
AssemblerBuilder.AssemblerImpl
public interface Assembler<T,RC>
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <C extends java.util.Collection<T>>
RCassemble(C topLevelEntities)static <T,ID,C extends java.util.Collection<T>,R,RC>
RCassemble(C topLevelEntities, java.util.function.Function<T,ID> idExtractor, java.util.List<io.github.pellse.util.query.Mapper<ID,?,?>> subQueryMappers, java.util.function.BiFunction<T,java.lang.Object[],R> aggregationFunction, AssemblerAdapter<ID,R,RC> assemblerAdapter, java.util.function.Function<java.lang.Throwable,java.lang.RuntimeException> errorConverter)default <C extends java.util.Collection<T>>
RCassembleFromSupplier(io.github.pellse.util.function.checked.CheckedSupplier<C,java.lang.Throwable> topLevelEntitiesProvider)
-
-
-
Method Detail
-
assembleFromSupplier
default <C extends java.util.Collection<T>> RC assembleFromSupplier(io.github.pellse.util.function.checked.CheckedSupplier<C,java.lang.Throwable> topLevelEntitiesProvider)
-
assemble
static <T,ID,C extends java.util.Collection<T>,R,RC> RC assemble(C topLevelEntities, java.util.function.Function<T,ID> idExtractor, java.util.List<io.github.pellse.util.query.Mapper<ID,?,?>> subQueryMappers, java.util.function.BiFunction<T,java.lang.Object[],R> aggregationFunction, AssemblerAdapter<ID,R,RC> assemblerAdapter, java.util.function.Function<java.lang.Throwable,java.lang.RuntimeException> errorConverter)- Type Parameters:
T- e.g.<Customer>ID- e.g.<Long>C- e.g.List<Customer>R- e.g.<Transaction>RC- e.g.Stream<Transaction>orFlux<Transaction>- Parameters:
topLevelEntities- e.g.List<Customer>idExtractor- e.g.Customer::getCustomerIdsubQueryMappers- e.g.[ Mapper<Long, BillingInfo>, Mapper<Long, List<OrderItem>> ]aggregationFunction- e.g.buildTransaction(customer, [ billingInfo, orderItemList ])assemblerAdapter- Pluggable execution engine for invoking top and sub queries (e.g. Project Reactor, RxJava)errorConverter- Converts any exception thrown into a user definedRuntimeException- Returns:
- A list of aggregated objects e.g.
Stream<Transaction>orFlux<Transaction>as specified by the assemblerAdapter return type
-
-