Record Class StateRebuildingCache.CacheKey<I>
java.lang.Object
java.lang.Record
com.opencqrs.framework.command.cache.StateRebuildingCache.CacheKey<I>
- Type Parameters:
I- the generic instance type being cached- Record Components:
subject- the correspondingCommand.getSubject()instanceClass- the correspondingCommandHandlerDefinition.instanceClass()and those of itsStateRebuildingHandlerDefinitions.sourcingMode- the correspondingCommandHandlerDefinition.sourcingMode()
- Enclosing interface:
StateRebuildingCache
public static record StateRebuildingCache.CacheKey<I>(@Nonnull String subject, @Nonnull Class<I> instanceClass, @Nonnull SourcingMode sourcingMode)
extends Record
Represents the cache key, whose
equality determines, which StateRebuildingCache.CacheValue to
fetch.-
Constructor Summary
ConstructorsConstructorDescriptionCacheKey(String subject, Class<I> instanceClass, SourcingMode sourcingMode) Creates an instance of aCacheKeyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theinstanceClassrecord component.Returns the value of thesourcingModerecord component.subject()Returns the value of thesubjectrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CacheKey
public CacheKey(@Nonnull String subject, @Nonnull Class<I> instanceClass, @Nonnull SourcingMode sourcingMode) Creates an instance of aCacheKeyrecord class.- Parameters:
subject- the value for thesubjectrecord componentinstanceClass- the value for theinstanceClassrecord componentsourcingMode- the value for thesourcingModerecord 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). -
subject
Returns the value of thesubjectrecord component.- Returns:
- the value of the
subjectrecord component
-
instanceClass
Returns the value of theinstanceClassrecord component.- Returns:
- the value of the
instanceClassrecord component
-
sourcingMode
Returns the value of thesourcingModerecord component.- Returns:
- the value of the
sourcingModerecord component
-