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 TypeMethodDescriptionbooleanReturns the category.Returns the content.longgetId()Returns the id.getLevel()Returns the level.Returns the recipients.Returns the sender.longgetTime()Returns the time.getTitle()Returns the title.getType()Returns the type of this message content.inthashCode()booleanisRead()Returns the read.voidsetCategory(String category) Sets the category.voidsetContent(Object content) Sets the content.voidsetId(long id) Sets the id.voidsetLevel(MessageLevel level) Sets the level.voidsetRead(boolean read) Sets the read.voidsetRecipients(Collection<String> recipients) Sets the recipients.voidSets the sender.voidsetTime(long time) Sets the time.voidSets the title.voidSets 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
-