Class MessageDto

java.lang.Object
com.qfs.snl.dtos.MessageDto

public class MessageDto extends Object
DTO representation of a message.
Author:
ActiveViam
  • Constructor Details Link icon

    • MessageDto Link icon

      public MessageDto()
      Constructor.
    • MessageDto Link icon

      public MessageDto(long id, long time, String sender, Collection<String> recipients, String title, MessageLevel level, String category, Object content, boolean read)
      Constructor.

      This sets the message type to the class name of the content if any.

      Parameters:
      id - the unique identifier of the message
      time - the time of creation of the message
      sender - the message sender
      recipients - list of recipients
      title - title of the message
      level - level of the message
      category - optional category of the message
      content - content of the message
      read - flag to indicate if the message is read (true) or not
    • MessageDto Link icon

      public MessageDto(IMessage message)
      Constructor from the interface.
      Parameters:
      message - the message to convert
  • Method Details Link icon

    • getContent Link icon

      public Object getContent()
      Returns the content.
    • setContent Link icon

      public void setContent(Object content)
      Sets the content.
      Parameters:
      content - The content to set
    • isRead Link icon

      public boolean isRead()
      Returns the read.
    • setRead Link icon

      public void setRead(boolean read)
      Sets the read.
      Parameters:
      read - The read to set
    • getId Link icon

      public long getId()
      Returns the id.
    • setId Link icon

      public void setId(long id)
      Sets the id.
      Parameters:
      id - The id to set
    • getTime Link icon

      public long getTime()
      Returns the time.
    • setTime Link icon

      public void setTime(long time)
      Sets the time.
      Parameters:
      time - The time to set, as an UNIX timestamp (ms)
    • getSender Link icon

      public String getSender()
      Returns the sender.
    • setSender Link icon

      public void setSender(String sender)
      Sets the sender.
      Parameters:
      sender - The sender to set
    • getRecipients Link icon

      public Collection<String> getRecipients()
      Returns the recipients.
    • setRecipients Link icon

      public void setRecipients(Collection<String> recipients)
      Sets the recipients.
      Parameters:
      recipients - The recipients to set
    • getTitle Link icon

      public String getTitle()
      Returns the title.
    • setTitle Link icon

      public void setTitle(String title)
      Sets the title.
      Parameters:
      title - The title to set
    • getLevel Link icon

      public MessageLevel getLevel()
      Returns the level.
    • setLevel Link icon

      public void setLevel(MessageLevel level)
      Sets the level.
      Parameters:
      level - The level to set
    • getCategory Link icon

      public String getCategory()
      Returns the category.
    • setCategory Link icon

      public void setCategory(String category)
      Sets the category.
      Parameters:
      category - The category to set
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals Link icon

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getType Link icon

      public String getType()
      Returns the type of this message content.
    • setType Link icon

      public void setType(String type)
      Sets the type of the message.
      Parameters:
      type - new message type
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object