Record Class Notification

java.lang.Object
java.lang.Record
io.vertigo.social.notification.Notification
Record Components:
uuid - Uuid
sender - Sender name
type - Type
title - Title
content - Content
ttlInSeconds - TimeToLive in seconds
creationDate - Create date
targetUrl - Target URL of this notification
userContentOpt - 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 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 a Notification record class.
      Parameters:
      uuid - the value for the uuid record component
      sender - the value for the sender record component
      type - the value for the type record component
      title - the value for the title record component
      content - the value for the content record component
      ttlInSeconds - the value for the ttlInSeconds record component
      creationDate - the value for the creationDate record component
      targetUrl - the value for the targetUrl record component
      userContentOpt - the value for the userContentOpt record component
  • Method Details

    • builder

      public static NotificationBuilder builder()
      Static method factory for NotificationBuilder
      Returns:
      NotificationBuilder
    • builder

      public static NotificationBuilder builder(UUID uuid)
      Static method factory for NotificationBuilder
      Parameters:
      uuid - Notification uuid
      Returns:
      NotificationBuilder
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • uuid

      public UUID uuid()
      Returns the value of the uuid record component.
      Returns:
      the value of the uuid record component
    • sender

      public String sender()
      Returns the value of the sender record component.
      Returns:
      the value of the sender record component
    • type

      public String type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • title

      public String title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • content

      public String content()
      Returns the value of the content record component.
      Returns:
      the value of the content record component
    • ttlInSeconds

      public int ttlInSeconds()
      Returns the value of the ttlInSeconds record component.
      Returns:
      the value of the ttlInSeconds record component
    • creationDate

      public Instant creationDate()
      Returns the value of the creationDate record component.
      Returns:
      the value of the creationDate record component
    • targetUrl

      public String targetUrl()
      Returns the value of the targetUrl record component.
      Returns:
      the value of the targetUrl record component
    • userContentOpt

      public Optional<String> userContentOpt()
      Returns the value of the userContentOpt record component.
      Returns:
      the value of the userContentOpt record component