Package com.norconex.commons.lang.event
Class Event
java.lang.Object
java.util.EventObject
com.norconex.commons.lang.event.Event
- All Implemented Interfaces:
Serializable
An immutable event.
- Since:
- 2.0.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classEvent.EventBuilder<C extends Event,B extends Event.EventBuilder<C, B>> -
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Event.EventBuilder<?, ?> builder()protected booleanbooleanThe exception associated with this event, ornull.A message describing the event or giving precision, ornullif the event has no message.@NonNull StringgetName()The event name (nevernull).inthashCode()booleanGets whether the supplied event has the same name as this event.booleanGets whether this event has the same name as any of the supplied names.toString()A string representation of this event.Methods inherited from class java.util.EventObject
getSource
-
Constructor Details
-
Event
-
-
Method Details
-
is
Gets whether the supplied event has the same name as this event. Equivalent to invokingthisEvent.is(thatEvent.getName()).- Parameters:
event- event to compare- Returns:
trueif events share the same name.
-
is
Gets whether this event has the same name as any of the supplied names.- Parameters:
eventName- event names- Returns:
trueif this event name matches one of supplied ones
-
toString
A string representation of this event.- Overrides:
toStringin classEventObject
-
builder
-
getName
The event name (nevernull). -
getMessage
A message describing the event or giving precision, ornullif the event has no message. -
getException
The exception associated with this event, ornull. -
equals
-
canEqual
-
hashCode
public int hashCode()
-