Record Class StateRebuildingCache.CacheValue<I>
java.lang.Object
java.lang.Record
com.opencqrs.framework.command.cache.StateRebuildingCache.CacheValue<I>
- Type Parameters:
I
- the generic instance type being cached- Record Components:
eventId
- the newestEvent.id()
this value representsinstance
- the cached object instancesourcedSubjectIds
- the sourced subjects and their correspondingEvent.id()
to reconstructPrecondition.SubjectIsOnEventId
s before applying new events. ThemergeFunction
is supposed to merge this map with any previous ids.
- Enclosing interface:
StateRebuildingCache
public static record StateRebuildingCache.CacheValue<I>(@Nullable String eventId, @Nullable I instance, @Nonnull Map<String,String> sourcedSubjectIds)
extends Record
Represents the cache value.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.eventId()
Returns the value of theeventId
record component.final int
hashCode()
Returns a hash code value for this object.instance()
Returns the value of theinstance
record component.Returns the value of thesourcedSubjectIds
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
CacheValue
public CacheValue(@Nullable String eventId, @Nullable I instance, @Nonnull Map<String, String> sourcedSubjectIds) Creates an instance of aCacheValue
record class.- Parameters:
eventId
- the value for theeventId
record componentinstance
- the value for theinstance
record componentsourcedSubjectIds
- the value for thesourcedSubjectIds
record component
-
-
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)
. -
eventId
Returns the value of theeventId
record component.- Returns:
- the value of the
eventId
record component
-
instance
Returns the value of theinstance
record component.- Returns:
- the value of the
instance
record component
-
sourcedSubjectIds
Returns the value of thesourcedSubjectIds
record component.- Returns:
- the value of the
sourcedSubjectIds
record component
-