Record Class EventHandlerMetadata

java.lang.Object
java.lang.Record
com.tnsai.events.handler.EventHandlerMetadata
Record Components:
eventName - the event name or pattern to match
pattern - whether eventName uses wildcard matching
async - whether handler runs asynchronously
order - execution order (lower first)
receiveSelf - whether to receive events from own agent
condition - SpEL condition (empty = always)
maxRetries - max retry attempts on failure
retryBackoffMs - retry backoff in milliseconds
timeout - handler timeout in milliseconds (0 = none)
method - the annotated handler method
declaringClass - 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 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 a EventHandlerMetadata record class.
      Parameters:
      eventName - the value for the eventName record component
      pattern - the value for the pattern record component
      async - the value for the async record component
      order - the value for the order record component
      receiveSelf - the value for the receiveSelf record component
      condition - the value for the condition record component
      maxRetries - the value for the maxRetries record component
      retryBackoffMs - the value for the retryBackoffMs record component
      timeout - the value for the timeout record component
      method - the value for the method record component
      declaringClass - the value for the declaringClass record component
  • Method Details

    • compareTo

      public int compareTo(EventHandlerMetadata other)
      Specified by:
      compareTo in interface Comparable<EventHandlerMetadata>
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • eventName

      public String eventName()
      Returns the value of the eventName record component.
      Returns:
      the value of the eventName record component
    • pattern

      public boolean pattern()
      Returns the value of the pattern record component.
      Returns:
      the value of the pattern record component
    • async

      public boolean async()
      Returns the value of the async record component.
      Returns:
      the value of the async record component
    • order

      public int order()
      Returns the value of the order record component.
      Returns:
      the value of the order record component
    • receiveSelf

      public boolean receiveSelf()
      Returns the value of the receiveSelf record component.
      Returns:
      the value of the receiveSelf record component
    • condition

      public String condition()
      Returns the value of the condition record component.
      Returns:
      the value of the condition record component
    • maxRetries

      public int maxRetries()
      Returns the value of the maxRetries record component.
      Returns:
      the value of the maxRetries record component
    • retryBackoffMs

      public int retryBackoffMs()
      Returns the value of the retryBackoffMs record component.
      Returns:
      the value of the retryBackoffMs record component
    • timeout

      public int timeout()
      Returns the value of the timeout record component.
      Returns:
      the value of the timeout record component
    • method

      public Method method()
      Returns the value of the method record component.
      Returns:
      the value of the method record component
    • declaringClass

      public Class<?> declaringClass()
      Returns the value of the declaringClass record component.
      Returns:
      the value of the declaringClass record component