Record Class EventHandlerDefinition<E>
java.lang.Object
java.lang.Record
com.opencqrs.framework.eventhandler.EventHandlerDefinition<E>
- Type Parameters:
E- the generic Java event type- Record Components:
group- group identifier forEventHandlerbelonging to the same processing groupeventClass- the Java event type to be handled, may beObjectto handle all eventshandler- the actual event handler
public record EventHandlerDefinition<E>(@NotBlank String group, @NotNull Class<E> eventClass, @NotNull EventHandler<E> handler)
extends Record
EventHandler definition suitable for being processed by an event processor.-
Constructor Summary
ConstructorsConstructorDescriptionEventHandlerDefinition(@NotBlank String group, @NotNull Class<E> eventClass, @NotNull EventHandler<E> handler) Creates an instance of aEventHandlerDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theeventClassrecord component.@NotBlank Stringgroup()Returns the value of thegrouprecord component.@NotNull EventHandler<E> handler()Returns the value of thehandlerrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EventHandlerDefinition
public EventHandlerDefinition(@NotBlank @NotBlank String group, @NotNull @NotNull Class<E> eventClass, @NotNull @NotNull EventHandler<E> handler) Creates an instance of aEventHandlerDefinitionrecord class.- Parameters:
group- the value for thegrouprecord 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). -
group
Returns the value of thegrouprecord component.- Returns:
- the value of the
grouprecord 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
-