public interface IntermediateEventRepresentation
Modifier and Type | Method and Description |
---|---|
boolean |
canConvertDataTo(Class<?> requiredType)
Checks if the data can be converted to the given
requiredType . |
Optional<String> |
getAggregateIdentifier()
Returns the Identifier of the Aggregate to which the Event owning the object to upcast, was applied.
|
Optional<String> |
getAggregateType()
Returns the Type of the Aggregate to which the Event owning the object to upcast, was applied.
|
default Class<?> |
getContentType()
Returns the type of this representation's
data . |
SerializedObject<?> |
getData()
Get the data of this representation.
|
<D> SerializedObject<D> |
getData(Class<D> requiredType)
Get the data of this representation.
|
String |
getMessageIdentifier()
Returns the identifier of the message wrapping the object to upcast.
|
LazyDeserializingObject<MetaData> |
getMetaData()
Returns the meta data of the message wrapping the object being upcast.
|
Optional<Long> |
getSequenceNumber()
Returns the sequence number of the event in the aggregate, or an empty Optional if the message wrapping the
object being upcast does not contain a sequence number.
|
Instant |
getTimestamp()
Returns the timestamp at which the event was first created.
|
Optional<TrackingToken> |
getTrackingToken()
Returns the tracking token of the event, or an empty Optional if the message wrapping the object being upcast
does not contain a tracking token.
|
SerializedType |
getType()
Returns the type and version of the data contained in this representation.
|
<T> IntermediateEventRepresentation |
upcast(SerializedType outputType,
Class<T> expectedRepresentationType,
Function<T,T> upcastFunction,
Function<MetaData,MetaData> metaDataUpcastFunction)
Upcast the serialized payload of the event (leaving other aspects of the event the same).
|
default <T> IntermediateEventRepresentation |
upcastPayload(SerializedType outputType,
Class<T> expectedRepresentationType,
Function<T,T> upcastFunction)
Upcast the serialized payload of the event (leaving other aspects of the event the same).
|
default <T> IntermediateEventRepresentation upcastPayload(SerializedType outputType, Class<T> expectedRepresentationType, Function<T,T> upcastFunction)
T
- The expected payload type before and after upcastingoutputType
- The output type of the event after upcastingexpectedRepresentationType
- The type of the serialized payload required by the upcast functionupcastFunction
- The upcast function for the event's payload<T> IntermediateEventRepresentation upcast(SerializedType outputType, Class<T> expectedRepresentationType, Function<T,T> upcastFunction, Function<MetaData,MetaData> metaDataUpcastFunction)
T
- The expected payload type before and after upcastingoutputType
- The output type of the event after upcastingexpectedRepresentationType
- The type of the serialized payload required by the upcast functionupcastFunction
- The upcast function for the event's payloadmetaDataUpcastFunction
- The upcast function for the event's metadataSerializedType getType()
SerializedObject<?> getData()
getType()
.<D> SerializedObject<D> getData(Class<D> requiredType)
requiredType
.requiredType
- the type to convert todefault Class<?> getContentType()
data
.data
.String getMessageIdentifier()
Optional<String> getAggregateType()
Optional<String> getAggregateIdentifier()
Optional<Long> getSequenceNumber()
Optional<TrackingToken> getTrackingToken()
Instant getTimestamp()
null
if the object being upcastLazyDeserializingObject<MetaData> getMetaData()
null
.boolean canConvertDataTo(Class<?> requiredType)
requiredType
.requiredType
- the type to validate if the contained data can be converted to.Copyright © 2010–2023. All rights reserved.