EventListenerRegistrationData (Apache Commons Configuration 2.15.1 API)
Description: declaration: package: org.apache.commons.configuration2.event, class: EventListenerRegistrationData

Package org.apache.commons.configuration2.event

# Class EventListenerRegistrationData<T extends Event>

java.lang.Object
org.apache.commons.configuration2.event.EventListenerRegistrationData<T>

Type Parameters:
  `T` - the type of events processed by the listener

public final class EventListenerRegistrationData<T extends Event> extends Object

A data class holding information about an event listener registration.

An instance of this class stores all information required to determine whether a specific event listener is to be invoked for a given event. The class is used internally by `EventListenerList`, but is also useful in general when information about event listeners is to be stored.

Implementation note: Instances of this class are immutable and can safely be shared between multiple threads or components.

Since:
  2.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `EventListenerRegistrationData(EventType<T> type, EventListener<? super T> lstnr)`
  Creates a new instance of `EventListenerRegistrationData`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  Compares this object with another one.
  `EventType<T>`
  `getEventType()`
  Gets the event type for this listener registration.
  `EventListener<? super T>`
  `getListener()`
  Gets the listener this registration is about.
  `int`
  `hashCode()`

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

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

- ## Constructor Details

  - ### EventListenerRegistrationData

    public EventListenerRegistrationData(EventType<T> type, EventListener<? super T> lstnr)
    Creates a new instance of `EventListenerRegistrationData`.
    Parameters:
      `type` - the event type (must not be null)
      `lstnr` - the event listener (must not be null)
    Throws:
      `IllegalArgumentException` - if a required parameter is null

- ## Method Details

  - ### equals

    public boolean equals(Object obj)
    Compares this object with another one. Two instances of `EventListenerRegistrationData` are considered equal if they reference the same listener and event type.
    Overrides:
      `equals` in class `Object`
    Parameters:
      `obj` - the object to be compared to
    Returns:
      a flag whether these objects are equal

  - ### getEventType

    public EventType<T> getEventType()
    Gets the event type for this listener registration.
    Returns:
      the event type

  - ### getListener

    public EventListener<? super T> getListener()
    Gets the listener this registration is about.
    Returns:
      the event listener

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`