Package com.norconex.commons.lang.event

# 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:
  - `EventListener`
  - Serialized Form

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `Event.EventBuilder<C extends Event,B extends Event.EventBuilder<C,B>>`

- ## Field Summary

  ### Fields inherited from class java.util.EventObject

  `source`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `Event(Event.EventBuilder<?,?> b)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static Event.EventBuilder<?,?>`
  `builder()`
  `protected boolean`
  `canEqual(Object other)`
  `boolean`
  `equals(Object o)`
  `Throwable`
  `getException()`
  The exception associated with this event, or `null`.
  `String`
  `getMessage()`
  A message describing the event or giving precision, or `null` if the event has no message.
  `@NonNull String`
  `getName()`
  The event name (never `null`).
  `int`
  `hashCode()`
  `boolean`
  `is(Event event)`
  Gets whether the supplied event has the same name as this event.
  `boolean`
  `is(String... eventName)`
  Gets whether this event has the same name as any of the supplied names.
  `String`
  `toString()`
  A string representation of this event.

  ### Methods inherited from class java.util.EventObject

  `getSource`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### Event

    protected Event(Event.EventBuilder<?,?> b)

- ## 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()