Package io.serialized.client.aggregate
Class AggregateFactory<A,T>
java.lang.Object
io.serialized.client.aggregate.AggregateFactory<A,T>
public class AggregateFactory<A,T> extends Object
-
Constructor Summary
Constructors Constructor Description AggregateFactory(Function<T,A> initializer, StateBuilder<T> stateBuilder) -
Method Summary
Modifier and Type Method Description AfromCommands(Command<A>... commands)Builds an aggregate root instance from a number of commands, useful for scenario testing.AfromCommands(List<Command<A>> commands)static <A, T> AggregateFactory<A,T>newFactory(Function<T,A> initializer, StateBuilder<T> stateBuilder)
-
Constructor Details
-
Method Details
-
fromCommands
-
fromCommands
Builds an aggregate root instance from a number of commands, useful for scenario testing.- Parameters:
commands- the commands to apply to build the aggregate root- Returns:
- aggregate root with the state from applying all commands in sequence.
-
newFactory
public static <A, T> AggregateFactory<A,T> newFactory(Function<T,A> initializer, StateBuilder<T> stateBuilder)
-