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
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe event type.private static final int
Constant for the factor used by the calculation of the hash code.private final EventListener<? super T>
The event listener. -
Constructor Summary
ConstructorsConstructorDescriptionEventListenerRegistrationData
(EventType<T> type, EventListener<? super T> lstnr) Creates a new instance ofEventListenerRegistrationData
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares this object with another one.Gets the event type for this listener registration.EventListener<? super T>
Gets the listener this registration is about.int
hashCode()
-
Field Details
-
HASH_FACTOR
private static final int HASH_FACTORConstant for the factor used by the calculation of the hash code.- See Also:
-
eventType
The event type. -
listener
The event listener.
-
-
Constructor Details
-
EventListenerRegistrationData
Creates a new instance ofEventListenerRegistrationData
.- 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
-
getEventType
Gets the event type for this listener registration.- Returns:
- the event type
-
getListener
Gets the listener this registration is about.- Returns:
- the event listener
-
hashCode
public int hashCode() -
equals
Compares this object with another one. Two instances ofEventListenerRegistrationData
are considered equal if they reference the same listener and event type.
-