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 MessageModelforMessage(de.xima.fc.api.rest.pub.client.form_record.model.BaseFormRecordMessageResource resource)List<UserPortalFileModel>getAttachments()StringgetContent()StringgetFormattedSendTime(Locale locale)PendingUploadRequestModelgetRelatedUploadModel()StringgetSenderName()Get the sender name.OffsetDateTimegetSentTime()InstantgetSentTimeInstant()StringgetSubject()Get the subject of the chat entry.InstantgetTimestamp()Get the sent time.UploadRequestModelgetUploadRequest()UUIDgetUuid()booleanhasAttachments()booleanhasFooter()Check if the chat entry has a footer.booleanhasUploadRequest()booleanisFirstMessageOfDay(List<MessageModel> messages)booleanisOwnMessage()Check if the chat entry is a message sent by the current user.booleanisRead()voidsetRelatedUploadModel(PendingUploadRequestModel relatedUploadModel)booleanshowReceivedMessage()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:IUserPortalChatEntryViewModelGet the sender name.- Specified by:
getSenderNamein interfaceIUserPortalChatEntryViewModel- Returns:
- the sender name
-
getTimestamp
public Instant getTimestamp()
Description copied from interface:IUserPortalChatEntryViewModelGet the sent time.- Specified by:
getTimestampin interfaceIUserPortalChatEntryViewModel- Returns:
- the sent time
-
hasFooter
public boolean hasFooter()
Description copied from interface:IUserPortalChatEntryViewModelCheck if the chat entry has a footer.- Specified by:
hasFooterin interfaceIUserPortalChatEntryViewModel- Returns:
- true if the chat entry has a footer, false otherwise
-
getSubject
public String getSubject()
Description copied from interface:IUserPortalChatEntryViewModelGet the subject of the chat entry.- Specified by:
getSubjectin interfaceIUserPortalChatEntryViewModel- Returns:
- the subject of the chat entry
-
isOwnMessage
public boolean isOwnMessage()
Description copied from interface:IUserPortalChatEntryViewModelCheck if the chat entry is a message sent by the current user.- Specified by:
isOwnMessagein 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
-
-