Package com.opencqrs.framework.command
Record Class StateRebuildingHandlerDefinition<I,E>
java.lang.Object
java.lang.Record
com.opencqrs.framework.command.StateRebuildingHandlerDefinition<I,E>
- Type Parameters:
I
- the instance typeE
- the event type to be sourced- Record Components:
instanceClass
- the instance type being event-sourcedeventClass
- the event type to be applied to any prior instance (state)handler
- the actual state rebuilding handler
public record StateRebuildingHandlerDefinition<I,E> (Class<I> instanceClass, Class<E> eventClass, StateRebuildingHandler<I,E> handler)
extends Record
StateRebuildingHandler
definition suitable for event-sourcing an instance prior to command handling
.-
Constructor Summary
ConstructorsConstructorDescriptionStateRebuildingHandlerDefinition
(Class<I> instanceClass, Class<E> eventClass, StateRebuildingHandler<I, E> handler) Creates an instance of aStateRebuildingHandlerDefinition
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Returns the value of theeventClass
record component.handler()
Returns the value of thehandler
record component.final int
hashCode()
Returns a hash code value for this object.Returns the value of theinstanceClass
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
StateRebuildingHandlerDefinition
public StateRebuildingHandlerDefinition(Class<I> instanceClass, Class<E> eventClass, StateRebuildingHandler<I, E> handler) Creates an instance of aStateRebuildingHandlerDefinition
record class.- Parameters:
instanceClass
- the value for theinstanceClass
record componenteventClass
- the value for theeventClass
record componenthandler
- the value for thehandler
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)
. -
instanceClass
Returns the value of theinstanceClass
record component.- Returns:
- the value of the
instanceClass
record component
-
eventClass
Returns the value of theeventClass
record component.- Returns:
- the value of the
eventClass
record component
-
handler
Returns the value of thehandler
record component.- Returns:
- the value of the
handler
record component
-