Class GenericUpcasterChain<T>
java.lang.Object
org.axonframework.serialization.upcasting.GenericUpcasterChain<T>
- All Implemented Interfaces:
Upcaster<T>
- Direct Known Subclasses:
EventUpcasterChain
Implementation of an
Upcaster that is formed of a chain of other upcasters which are combined to upcast a
stream of intermediate objects.- Since:
- 3.0
- Author:
- Rene de Waele
-
Constructor Summary
ConstructorsConstructorDescriptionGenericUpcasterChain(List<? extends Upcaster<T>> upcasters) Initializes an upcaster chain from the given list of upcasters.GenericUpcasterChain(Upcaster<T>... upcasters) Initializes an upcaster chain from one or more upcasters. -
Method Summary
-
Constructor Details
-
GenericUpcasterChain
Initializes an upcaster chain from one or more upcasters.- Parameters:
upcasters- the upcasters to chain
-
GenericUpcasterChain
Initializes an upcaster chain from the given list of upcasters.- Parameters:
upcasters- the upcasters to chain
-
-
Method Details
-
upcast
Description copied from interface:UpcasterApply this upcaster to a stream ofintermediateRepresentationsand return the altered stream.To upcast an object an upcaster should apply a mapping function to the input stream (
Stream.map(java.util.function.Function)). To remove an object from the stream the upcaster should filter the input stream (Stream.filter(java.util.function.Predicate)). To split an input object into more than one objects useStream.flatMap(java.util.function.Function).In some cases the upcasting result of an Upcaster may depend on more than one input object. In that case an Upcaster may store state in the method during upcasting or even read ahead in the stream.
-
getUpcasters
Returns the list ofupcastersthat makes up this chain.- Returns:
- the upcaster chain
-