Package com.qfs.snl.dtos
Class MessageDto
java.lang.Object
com.qfs.snl.dtos.MessageDto
DTO representation of a message.
- Author:
- ActiveViam
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.MessageDto
(long id, long time, String sender, Collection<String> recipients, String title, MessageLevel level, String category, Object content, boolean read) Constructor.MessageDto
(IMessage message) Constructor from the interface. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the category.Returns the content.long
getId()
Returns the id.getLevel()
Returns the level.Returns the recipients.Returns the sender.long
getTime()
Returns the time.getTitle()
Returns the title.getType()
Returns the type of this message content.int
hashCode()
boolean
isRead()
Returns the read.void
setCategory
(String category) Sets the category.void
setContent
(Object content) Sets the content.void
setId
(long id) Sets the id.void
setLevel
(MessageLevel level) Sets the level.void
setRead
(boolean read) Sets the read.void
setRecipients
(Collection<String> recipients) Sets the recipients.void
Sets the sender.void
setTime
(long time) Sets the time.void
Sets the title.void
Sets the type of the message.toString()
-
Constructor Details
-
MessageDto
public MessageDto()Constructor. -
MessageDto
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 messagetime
- the time of creation of the messagesender
- the message senderrecipients
- list of recipientstitle
- title of the messagelevel
- level of the messagecategory
- optional category of the messagecontent
- content of the messageread
- flag to indicate if the message is read (true) or not
-
MessageDto
Constructor from the interface.- Parameters:
message
- the message to convert
-
-
Method Details
-
getContent
Returns the content. -
setContent
Sets the content.- Parameters:
content
- The content to set
-
isRead
public boolean isRead()Returns the read. -
setRead
public void setRead(boolean read) Sets the read.- Parameters:
read
- The read to set
-
getId
public long getId()Returns the id. -
setId
public void setId(long id) Sets the id.- Parameters:
id
- The id to set
-
getTime
public long getTime()Returns the time. -
setTime
public void setTime(long time) Sets the time.- Parameters:
time
- The time to set, as an UNIX timestamp (ms)
-
getSender
Returns the sender. -
setSender
Sets the sender.- Parameters:
sender
- The sender to set
-
getRecipients
Returns the recipients. -
setRecipients
Sets the recipients.- Parameters:
recipients
- The recipients to set
-
getTitle
Returns the title. -
setTitle
Sets the title.- Parameters:
title
- The title to set
-
getLevel
Returns the level. -
setLevel
Sets the level.- Parameters:
level
- The level to set
-
getCategory
Returns the category. -
setCategory
Sets the category.- Parameters:
category
- The category to set
-
hashCode
public int hashCode() -
equals
-
getType
Returns the type of this message content. -
setType
Sets the type of the message.- Parameters:
type
- new message type
-
toString
-