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:
  • Constructor Details

    • NotificationEvent

      public NotificationEvent(NotificationEventType eventType, TPayload payload)
      Creates a new NotificationEvent instance.
      Parameters:
      eventType - The event type
      payload - The payload of the event, can be null.
  • Method Details

    • 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
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object