Class Notification

java.lang.Object
com.example.skeddly.business.database.DatabaseObject
com.example.skeddly.business.notification.Notification

public class Notification extends DatabaseObject
Represents a single notification item within the application. This class holds all relevant data for a notification, such as its type, content, and status.
  • Constructor Details

    • Notification

      public Notification()
      Default constructor for creating a new Notification. Sets its read status to false and status to pending.
    • Notification

      public Notification(String title, String message, String recipient, NotificationType type)
      Construct a notification with the given title and message.
      Parameters:
      title - The title to set on the notification.
      message - The message that it should contain.
      recipient - The user id of the recipient of the message.
      type - The type of notification it is
  • Method Details

    • getTitle

      public String getTitle()
      Gets the title of the notification.
      Returns:
      A string containing the title.
    • setTitle

      public void setTitle(String title)
      Sets the title of the notification.
      Parameters:
      title - The string title to set.
    • getRecipient

      public String getRecipient()
      Gets the recipient of the notification.
      Returns:
      The user id of the recipient
    • setRecipient

      public void setRecipient(String recipient)
      Sets the recipient of the notification.
      Parameters:
      recipient - The user id of the recipient
    • getMessage

      public String getMessage()
      Gets the main message content of the notification.
      Returns:
      A string containing the message.
    • setMessage

      public void setMessage(String message)
      Sets the main message content for the notification.
      Parameters:
      message - The string message to set.
    • getTimestamp

      public long getTimestamp()
      Gets the timestamp indicating when the notification was created.
      Returns:
      A Date object representing the creation time.
    • setTimestamp

      public void setTimestamp(long timestamp)
      Sets the timestamp for the notification.
      Parameters:
      timestamp - The Date to set.
    • getType

      public NotificationType getType()
      Gets the type of the notification.
      Returns:
      The NotificationType enum value.
    • setType

      public void setType(NotificationType type)
      Sets the type of the notification.
      Parameters:
      type - The NotificationType enum value to set.
    • getTicketId

      public String getTicketId()
      Gets the ID of the ticket associated with this notification, if any.
      Returns:
      A string representing the ticket ID.
    • setTicketId

      public void setTicketId(String ticketId)
      Sets the ticket ID associated with this notification.
      Parameters:
      ticketId - The string ticket ID to set.
    • isRead

      public boolean isRead()
      Checks if the notification has been marked as read.
      Returns:
      A boolean, true if read, false otherwise.
    • setRead

      public void setRead(boolean read)
      Sets the read status of the notification.
      Parameters:
      read - The boolean status to set.
    • getStatus

      public NotificationInvitationStatus getStatus()
      Gets the status of an invitation notification.
      Returns:
      The NotificationInvitationStatus enum value.
    • setStatus

      public void setStatus(NotificationInvitationStatus status)
      Sets the status for an invitation notification.
      Parameters:
      status - The NotificationInvitationStatus enum value to set.