Package io.vertigo.social.notification
Record Class Notification
java.lang.Object
java.lang.Record
io.vertigo.social.notification.Notification
- Record Components:
uuid- Uuidsender- Sender nametype- Typetitle- Titlecontent- ContentttlInSeconds- TimeToLive in secondscreationDate- Create datetargetUrl- Target URL of this notificationuserContentOpt- Reader's specific content of this notification (can't be empty)
public record Notification(UUID uuid, String sender, String type, String title, String content, int ttlInSeconds, Instant creationDate, String targetUrl, Optional<String> userContentOpt)
extends Record
- Author:
- pchretien, npiedeloup, btounkara
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic NotificationBuilderbuilder()Static method factory for NotificationBuilderstatic NotificationBuilderStatic method factory for NotificationBuildercontent()Returns the value of thecontentrecord component.Returns the value of thecreationDaterecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.sender()Returns the value of thesenderrecord component.Returns the value of thetargetUrlrecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thettlInSecondsrecord component.type()Returns the value of thetyperecord component.Returns the value of theuserContentOptrecord component.uuid()Returns the value of theuuidrecord component.
-
Constructor Details
-
Notification
public Notification(UUID uuid, String sender, String type, String title, String content, int ttlInSeconds, Instant creationDate, String targetUrl, Optional<String> userContentOpt) Creates an instance of aNotificationrecord class.- Parameters:
uuid- the value for theuuidrecord componentsender- the value for thesenderrecord componenttype- the value for thetyperecord componenttitle- the value for thetitlerecord componentcontent- the value for thecontentrecord componentttlInSeconds- the value for thettlInSecondsrecord componentcreationDate- the value for thecreationDaterecord componenttargetUrl- the value for thetargetUrlrecord componentuserContentOpt- the value for theuserContentOptrecord component
-
-
Method Details
-
builder
Static method factory for NotificationBuilder- Returns:
- NotificationBuilder
-
builder
Static method factory for NotificationBuilder- Parameters:
uuid- Notification uuid- Returns:
- NotificationBuilder
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
uuid
Returns the value of theuuidrecord component.- Returns:
- the value of the
uuidrecord component
-
sender
Returns the value of thesenderrecord component.- Returns:
- the value of the
senderrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
content
Returns the value of thecontentrecord component.- Returns:
- the value of the
contentrecord component
-
ttlInSeconds
public int ttlInSeconds()Returns the value of thettlInSecondsrecord component.- Returns:
- the value of the
ttlInSecondsrecord component
-
creationDate
Returns the value of thecreationDaterecord component.- Returns:
- the value of the
creationDaterecord component
-
targetUrl
Returns the value of thetargetUrlrecord component.- Returns:
- the value of the
targetUrlrecord component
-
userContentOpt
Returns the value of theuserContentOptrecord component.- Returns:
- the value of the
userContentOptrecord component
-