Record Class NotificationDraft
java.lang.Object
java.lang.Record
com.example.orderplatform.notifications.domain.NotificationDraft
- Record Components:
recipient- logical recipientchannel- supported channel, eitherEMAILorWEBHOOKtype- notification business typepayload- notification payload text
public record NotificationDraft(String recipient, String channel, String type, String payload)
extends Record
Validated notification intent before it is persisted.
The module records intents for email and webhook channels; it does not deliver messages to external systems.
-
Constructor Summary
ConstructorsConstructorDescriptionNotificationDraft(String recipient, String channel, String type, String payload) Creates an instance of aNotificationDraftrecord class. -
Method Summary
Modifier and TypeMethodDescriptionchannel()Returns the value of thechannelrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.payload()Returns the value of thepayloadrecord component.Returns the value of therecipientrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
recipient
Returns the value of therecipientrecord component.- Returns:
- the value of the
recipientrecord component
-
channel
Returns the value of thechannelrecord component.- Returns:
- the value of the
channelrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
payload
Returns the value of thepayloadrecord component.- Returns:
- the value of the
payloadrecord component
-