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 itsStateRebuildingHandlerDefinition
s.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 aCacheKey
record class. -
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.Returns the value of theinstanceClass
record component.Returns the value of thesourcingMode
record component.subject()
Returns the value of thesubject
record component.final String
toString()
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 aCacheKey
record class.- Parameters:
subject
- the value for thesubject
record componentinstanceClass
- the value for theinstanceClass
record componentsourcingMode
- the value for thesourcingMode
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)
. -
subject
Returns the value of thesubject
record component.- Returns:
- the value of the
subject
record component
-
instanceClass
Returns the value of theinstanceClass
record component.- Returns:
- the value of the
instanceClass
record component
-
sourcingMode
Returns the value of thesourcingMode
record component.- Returns:
- the value of the
sourcingMode
record component
-