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.SubjectIsOnEventIds before applying new events. ThemergeFunctionis 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 booleanIndicates whether some other object is "equal to" this one.eventId()Returns the value of theeventIdrecord component.final inthashCode()Returns a hash code value for this object.instance()Returns the value of theinstancerecord component.Returns the value of thesourcedSubjectIdsrecord component.final StringtoString()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 aCacheValuerecord class.- Parameters:
eventId- the value for theeventIdrecord componentinstance- the value for theinstancerecord componentsourcedSubjectIds- the value for thesourcedSubjectIdsrecord 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 theeventIdrecord component.- Returns:
- the value of the
eventIdrecord component
-
instance
Returns the value of theinstancerecord component.- Returns:
- the value of the
instancerecord component
-
sourcedSubjectIds
Returns the value of thesourcedSubjectIdsrecord component.- Returns:
- the value of the
sourcedSubjectIdsrecord component
-