Class Notification
java.lang.Object
com.pyranid.Notification
A named database notification received by a
NotificationSession.
Notifications are transient, lossy hints rather than durable events. An implementation may coalesce notifications,
and the number of returned Notification instances does not represent an underlying event count.
This value deliberately omits any backend-specific sender identifier. Payload nullability and null/empty-string handling are database-specific; Pyranid performs no generic normalization.
- Since:
- 4.6.0
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionboolean@NonNull StringGets the notification channel.@Nullable StringGets the notification payload.inthashCode()static @NonNull NotificationCreates a notification value.@NonNull StringtoString()Returns a diagnostic representation containing the channel and payload length, but never the payload contents.
-
Method Details
-
of
Creates a notification value.This factory enforces the common channel contract but does not apply backend-specific byte limits.
- Parameters:
channel- nonblank notification channel, which must not contain a NUL characterpayload- notification payload, which may be null or empty- Returns:
- a notification value
- Throws:
NullPointerException- ifchannelis nullIllegalArgumentException- ifchannelis blank or contains a NUL character- Since:
- 4.6.0
-
getChannel
Gets the notification channel.- Returns:
- notification channel
- Since:
- 4.6.0
-
getPayload
Gets the notification payload.- Returns:
- notification payload, which may be null or empty according to backend behavior
- Since:
- 4.6.0
-
equals
-
hashCode
-
toString
Returns a diagnostic representation containing the channel and payload length, but never the payload contents. A non-null payload's length is its JavaString.length()in UTF-16 code units, not a backend-specific encoded byte count.
-