Record Class EventData<E>
java.lang.Object
java.lang.Record
com.opencqrs.framework.serialization.EventData<E>
- Type Parameters:
E
- the generic object type- Record Components:
metaData
- the meta-data stored withinEventCandidate.data()
orEvent.data()
payload
- the Java object payload stored withinEventCandidate.data()
orEvent.data()
Represents unmarshalled
EventCandidate.data()
or Event.data()
, respectively. The framework, in
contrast to the EsdbClient
, distinguishes between an event's
payload and additional meta-data. While the former
is used for storing actual Java objects, the latter one can store additional key-value pairs, if needed.
Implementations of this interface may choose to ignore the meta-data
when
marshalling, if there is no need for meta-data support within the application. However, be aware of event
immutability which may render events non-marshallable, in case the EventDataMarshaller
implementation needs
to be changed, after events have already been stored.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.metaData()
Returns the value of themetaData
record component.payload()
Returns the value of thepayload
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
metaData
Returns the value of themetaData
record component.- Returns:
- the value of the
metaData
record component
-
payload
Returns the value of thepayload
record component.- Returns:
- the value of the
payload
record component
-