Package com.tnsai.events.handler
Record Class EventHandlerMetadata
java.lang.Object
java.lang.Record
com.tnsai.events.handler.EventHandlerMetadata
- Record Components:
eventName- the event name or pattern to matchpattern- whether eventName uses wildcard matchingasync- whether handler runs asynchronouslyorder- execution order (lower first)receiveSelf- whether to receive events from own agentcondition- SpEL condition (empty = always)maxRetries- max retry attempts on failureretryBackoffMs- retry backoff in millisecondstimeout- handler timeout in milliseconds (0 = none)method- the annotated handler methoddeclaringClass- the class declaring the method
- All Implemented Interfaces:
Comparable<EventHandlerMetadata>
public record EventHandlerMetadata(String eventName, boolean pattern, boolean async, int order, boolean receiveSelf, String condition, int maxRetries, int retryBackoffMs, int timeout, Method method, Class<?> declaringClass)
extends Record
implements Comparable<EventHandlerMetadata>
Metadata extracted from an
EventHandler annotation.-
Constructor Summary
ConstructorsConstructorDescriptionEventHandlerMetadata(String eventName, boolean pattern, boolean async, int order, boolean receiveSelf, String condition, int maxRetries, int retryBackoffMs, int timeout, Method method, Class<?> declaringClass) Creates an instance of aEventHandlerMetadatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanasync()Returns the value of theasyncrecord component.intcompareTo(EventHandlerMetadata other) Returns the value of theconditionrecord component.Class<?> Returns the value of thedeclaringClassrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theeventNamerecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxRetriesrecord component.method()Returns the value of themethodrecord component.intorder()Returns the value of theorderrecord component.booleanpattern()Returns the value of thepatternrecord component.booleanReturns the value of thereceiveSelfrecord component.intReturns the value of theretryBackoffMsrecord component.inttimeout()Returns the value of thetimeoutrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EventHandlerMetadata
public EventHandlerMetadata(String eventName, boolean pattern, boolean async, int order, boolean receiveSelf, String condition, int maxRetries, int retryBackoffMs, int timeout, Method method, Class<?> declaringClass) Creates an instance of aEventHandlerMetadatarecord class.- Parameters:
eventName- the value for theeventNamerecord componentpattern- the value for thepatternrecord componentasync- the value for theasyncrecord componentorder- the value for theorderrecord componentreceiveSelf- the value for thereceiveSelfrecord componentcondition- the value for theconditionrecord componentmaxRetries- the value for themaxRetriesrecord componentretryBackoffMs- the value for theretryBackoffMsrecord componenttimeout- the value for thetimeoutrecord componentmethod- the value for themethodrecord componentdeclaringClass- the value for thedeclaringClassrecord component
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<EventHandlerMetadata>
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
eventName
Returns the value of theeventNamerecord component.- Returns:
- the value of the
eventNamerecord component
-
pattern
public boolean pattern()Returns the value of thepatternrecord component.- Returns:
- the value of the
patternrecord component
-
async
public boolean async()Returns the value of theasyncrecord component.- Returns:
- the value of the
asyncrecord component
-
order
public int order()Returns the value of theorderrecord component.- Returns:
- the value of the
orderrecord component
-
receiveSelf
public boolean receiveSelf()Returns the value of thereceiveSelfrecord component.- Returns:
- the value of the
receiveSelfrecord component
-
condition
Returns the value of theconditionrecord component.- Returns:
- the value of the
conditionrecord component
-
maxRetries
public int maxRetries()Returns the value of themaxRetriesrecord component.- Returns:
- the value of the
maxRetriesrecord component
-
retryBackoffMs
public int retryBackoffMs()Returns the value of theretryBackoffMsrecord component.- Returns:
- the value of the
retryBackoffMsrecord component
-
timeout
public int timeout()Returns the value of thetimeoutrecord component.- Returns:
- the value of the
timeoutrecord component
-
method
Returns the value of themethodrecord component.- Returns:
- the value of the
methodrecord component
-
declaringClass
Returns the value of thedeclaringClassrecord component.- Returns:
- the value of the
declaringClassrecord component
-