Class NotificationEvent<TPayload extends NotificationEventPayload>
- java.lang.Object
-
- de.xima.fc.notification.mgmt.event.NotificationEvent<TPayload>
-
- Type Parameters:
TPayload- The type of the payload, which must extend `NotificationPayload`.
- All Implemented Interfaces:
Serializable
public final class NotificationEvent<TPayload extends NotificationEventPayload> extends Object implements Serializable
Represents a notification event with a payload of type `TPayload`.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NotificationEvent(NotificationEventType eventType, TPayload payload)Creates a newNotificationEventinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)InstantgetCreationTime()The timestamp when the event was created.NotificationEventTypegetEventType()The event typeOptional<TPayload>getPayload()Gets the payload of the event, if present.inthashCode()StringtoString()
-
-
-
Constructor Detail
-
NotificationEvent
public NotificationEvent(NotificationEventType eventType, TPayload payload)
Creates a newNotificationEventinstance.- Parameters:
eventType- The event typepayload- The payload of the event, can be null.
-
-
Method Detail
-
getPayload
public Optional<TPayload> getPayload()
Gets the payload of the event, if present.- Returns:
- An `Optional` containing the payload, or an empty `Optional` if no payload is present.
-
getCreationTime
public Instant getCreationTime()
The timestamp when the event was created.
-
getEventType
public NotificationEventType getEventType()
The event type
-
-