Class CommandConversion
java.lang.Object
org.occurrent.application.composition.command.CommandConversion
Utility functions to convert functions expecting a list of domain events into a functions expecting a stream of domain events,
and vice versa.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiontoListCommand(Function<Stream<T>, Stream<T>> command) Convert a command takingStream<T>into one that takes aList<T>.toStreamCommand(Function<List<T>, List<T>> command) Convert a command takingList<T>into one that takes aStream<T>.
-
Constructor Details
-
CommandConversion
public CommandConversion()
-
-
Method Details
-
toListCommand
Convert a command takingStream<T>into one that takes aList<T>.- Type Parameters:
T- The type of the domain event- Parameters:
command- The command to convert- Returns:
- A function that does the conversion described above.
-
toStreamCommand
Convert a command takingList<T>into one that takes aStream<T>.- Type Parameters:
T- The type of the domain event- Parameters:
command- The command to convert- Returns:
- A function that does the conversion described above.
-