Class Event

java.lang.Object
java.util.EventObject
com.norconex.commons.lang.event.Event
All Implemented Interfaces:
Serializable

public class Event extends EventObject
An immutable event.
Since:
2.0.0
See Also:
  • Constructor Details

  • Method Details

    • is

      public boolean is(Event event)
      Gets whether the supplied event has the same name as this event. Equivalent to invoking thisEvent.is(thatEvent.getName()).
      Parameters:
      event - event to compare
      Returns:
      true if events share the same name.
    • is

      public boolean is(String... eventName)
      Gets whether this event has the same name as any of the supplied names.
      Parameters:
      eventName - event names
      Returns:
      true if this event name matches one of supplied ones
    • toString

      public String toString()
      A string representation of this event.
      Overrides:
      toString in class EventObject
    • builder

      public static Event.EventBuilder<?,?> builder()
    • getName

      @NonNull public @NonNull String getName()
      The event name (never null).
    • getMessage

      public String getMessage()
      A message describing the event or giving precision, or null if the event has no message.
    • getException

      public Throwable getException()
      The exception associated with this event, or null.
    • equals

      public boolean equals(Object o)
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()