Class Message
java.lang.Object
com.gentics.contentnode.rest.model.response.Message
- All Implemented Interfaces:
Serializable
Represents a message that can be displayed in the MessageLine.
- Author:
- floriangutmann
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionMessage()
Default constructor needed for JAXBMessage
(Message.Type type, String message) Simple constructor for a message.Message
(Message.Type type, String fieldName, String message) Constructor for a message for a specific REST model field.Message
(Message.Type type, String message, String image, long timestamp) Constructor for a Message with an image and a timestamp.Message
(Message.Type type, String fieldName, String message, String image, long timestamp) Constructor with all parameters. -
Method Summary
Modifier and TypeMethodDescriptionThe name of the REST model field this message is about.getId()
Get the message idgetImage()
Get the sender of the messagelong
getType()
boolean
isExpired
(int instantTimeMinutes) Helper function to determine if a message is an instant message.setFieldName
(String fieldName) Set the name of the REST model field this message is about.Set the message idsetInstantMessage
(boolean instantMessage) Sets the value of the isInstantMessage variable.setMessage
(String message) Set the sender of the messagesetTimestamp
(long timestamp) setType
(Message.Type type) toString()
-
Constructor Details
-
Message
public Message()Default constructor needed for JAXB -
Message
Constructor with all parameters.- Parameters:
type
- TheMessage.Type
of the message.fieldName
- The name of the REST model field this message is about.message
- The text of the message.image
- The URL of the image that should be displayed aside the message.timestamp
- The timestamp of the message.
-
Message
Constructor for a message for a specific REST model field. Theimage
will benull
and thetimestamp
will be set to the current time.- Parameters:
type
- The type of the message.fieldName
- The name of the REST model field this message is about.message
- The text of the message.
-
Message
Constructor for a Message with an image and a timestamp.- Parameters:
type
- Type of the messagemessage
- Text of the messageimage
- URL of the image that should be displayed aside the message
-
Message
Simple constructor for a message. The timestamp of the message will be set to the actual time. Image of the message will be null.- Parameters:
type
- Type of the messagemessage
- Text of the message
-
-
Method Details
-
getFieldName
The name of the REST model field this message is about.- Returns:
- The name of the REST model field this message is about,
or
null
if this message is not about a specific REST model field.
-
setFieldName
Set the name of the REST model field this message is about.- Parameters:
fieldName
- Set the name of the REST model field this message is about (can be null).- Returns:
- fluent API
-
getMessage
-
setMessage
-
getType
-
setType
-
getTimestamp
public long getTimestamp() -
setTimestamp
-
getImage
-
setImage
-
getSender
Get the sender of the message- Returns:
- message sender
-
setSender
Set the sender of the message- Parameters:
sender
- message sender- Returns:
- fluent API
-
setId
Set the message id- Parameters:
id
- id of the message- Returns:
- fluent API
-
getId
Get the message id- Returns:
- id of the message
-
toString
-
isExpired
public boolean isExpired(int instantTimeMinutes) Helper function to determine if a message is an instant message. If the messages is expired, it is not considered as an instant message- Returns:
- returns true if the message is expired, false otherwise
-
setInstantMessage
Sets the value of the isInstantMessage variable.- Parameters:
instantMessage
- a boolean value that represents if the message is instant- Returns:
- fluent API
-