Class MessageModel
- java.lang.Object
-
- de.xima.fc.user_portal.view_model.messages.MessageModel
-
- All Implemented Interfaces:
IUserPortalChatEntryViewModel
,Serializable
public class MessageModel extends Object implements IUserPortalChatEntryViewModel
Message model class with builder pattern.- Since:
- 8.4.0
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MessageModel
forMessage(de.xima.fc.api.rest.pub.client.form_record.model.BaseFormRecordMessageResource resource)
List<UserPortalFileModel>
getAttachments()
String
getContent()
String
getFormattedSendTime(Locale locale)
PendingUploadRequestModel
getRelatedUploadModel()
String
getSenderName()
Get the sender name.OffsetDateTime
getSentTime()
Instant
getSentTimeInstant()
String
getSubject()
Get the subject of the chat entry.Instant
getTimestamp()
Get the sent time.UploadRequestModel
getUploadRequest()
UUID
getUuid()
boolean
hasAttachments()
boolean
hasFooter()
Check if the chat entry has a footer.boolean
hasUploadRequest()
boolean
isFirstMessageOfDay(List<MessageModel> messages)
boolean
isOwnMessage()
Check if the chat entry is a message sent by the current user.boolean
isRead()
void
setRelatedUploadModel(PendingUploadRequestModel relatedUploadModel)
boolean
showReceivedMessage()
Show the received message if it is not an own message and there are no upload requests with files.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.xima.fc.user_portal.view_model.messages.IUserPortalChatEntryViewModel
getSenderInitials
-
-
-
-
Method Detail
-
forMessage
public static MessageModel forMessage(de.xima.fc.api.rest.pub.client.form_record.model.BaseFormRecordMessageResource resource)
-
getAttachments
public List<UserPortalFileModel> getAttachments()
-
getContent
public String getContent()
-
getSenderName
public String getSenderName()
Description copied from interface:IUserPortalChatEntryViewModel
Get the sender name.- Specified by:
getSenderName
in interfaceIUserPortalChatEntryViewModel
- Returns:
- the sender name
-
getTimestamp
public Instant getTimestamp()
Description copied from interface:IUserPortalChatEntryViewModel
Get the sent time.- Specified by:
getTimestamp
in interfaceIUserPortalChatEntryViewModel
- Returns:
- the sent time
-
hasFooter
public boolean hasFooter()
Description copied from interface:IUserPortalChatEntryViewModel
Check if the chat entry has a footer.- Specified by:
hasFooter
in interfaceIUserPortalChatEntryViewModel
- Returns:
- true if the chat entry has a footer, false otherwise
-
getSubject
public String getSubject()
Description copied from interface:IUserPortalChatEntryViewModel
Get the subject of the chat entry.- Specified by:
getSubject
in interfaceIUserPortalChatEntryViewModel
- Returns:
- the subject of the chat entry
-
isOwnMessage
public boolean isOwnMessage()
Description copied from interface:IUserPortalChatEntryViewModel
Check if the chat entry is a message sent by the current user.- Specified by:
isOwnMessage
in interfaceIUserPortalChatEntryViewModel
- Returns:
- true if the chat entry is a message sent by the current user, false otherwise
-
getSentTime
public OffsetDateTime getSentTime()
-
getSentTimeInstant
public Instant getSentTimeInstant()
-
getUploadRequest
public UploadRequestModel getUploadRequest()
-
getUuid
public UUID getUuid()
-
hasAttachments
public boolean hasAttachments()
-
hasUploadRequest
public boolean hasUploadRequest()
-
isFirstMessageOfDay
public boolean isFirstMessageOfDay(List<MessageModel> messages)
-
isRead
public boolean isRead()
-
getRelatedUploadModel
public PendingUploadRequestModel getRelatedUploadModel()
- Returns:
- the related 'pending upload request' model belonging to this message or null, if this one is just a simple text message
-
setRelatedUploadModel
public void setRelatedUploadModel(PendingUploadRequestModel relatedUploadModel)
- Parameters:
relatedUploadModel
- the related 'pending upload request' model belonging to this message
-
showReceivedMessage
public boolean showReceivedMessage()
Show the received message if it is not an own message and there are no upload requests with files.- Returns:
- true if the message should be shown, false otherwise
-
-