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 aStateRebuildingHandlerDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theeventClassrecord component.handler()Returns the value of thehandlerrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theinstanceClassrecord component.final StringtoString()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 aStateRebuildingHandlerDefinitionrecord class.- Parameters:
instanceClass- the value for theinstanceClassrecord componenteventClass- the value for theeventClassrecord componenthandler- the value for thehandlerrecord 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 theinstanceClassrecord component.- Returns:
- the value of the
instanceClassrecord component
-
eventClass
Returns the value of theeventClassrecord component.- Returns:
- the value of the
eventClassrecord component
-
handler
Returns the value of thehandlerrecord component.- Returns:
- the value of the
handlerrecord component
-