Class Message
java.lang.Object
no.digipost.api.client.representations.Message
- All Implemented Interfaces:
MayHaveSender
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Batch
final ZonedDateTime
final String
final String
final Document
final PrintIfUnread
final MessageRecipient
final RequestForRegistration
final Long
final SenderOrganization
Fields inherited from interface no.digipost.api.client.representations.MayHaveSender
NO_SENDER
-
Method Summary
Modifier and TypeMethodDescriptionstatic Message
copyMessageWithOnlyDigipostDetails
(Message messageToCopy) static Message
copyPrintMessage
(Message messageToCopy) Copies a message and forces all its documents to have file type of PDF.Comparator<? super Document>
boolean
boolean
boolean
isSameMessageAs
(Message message) static Message.MessageBuilder
newMessage
(String messageId, Document primaryDocument) static Message.MessageBuilder
newMessage
(UUID messageId, Document primaryDocument) toString()
-
Field Details
-
messageId
-
senderId
-
senderOrganization
-
recipient
-
deliveryTime
-
invoiceReference
-
-
attachments
-
printIfUnread
-
requestForRegistration
-
batch
-
-
Method Details
-
newMessage
-
newMessage
-
copyPrintMessage
Copies a message and forces all its documents to have file type of PDF.- Parameters:
messageToCopy
- message to copy- Returns:
- a copy of
messageToCopy
-
copyMessageWithOnlyDigipostDetails
-
getAllDocuments
- Returns:
- an ordered Stream containing every
Document
in this message. The primary document will be the first element of the list, with the attachments following.
-
isDirectPrint
public boolean isDirectPrint() -
isSameMessageAs
-
hasAnyDocumentRequiringEncryption
public boolean hasAnyDocumentRequiringEncryption() -
getChannel
-
documentOrder
- Returns:
Comparator
which order documents by the same order as they are contained in this message. If a document
-
getSenderId
- Specified by:
getSenderId
in interfaceMayHaveSender
- Returns:
- the sender ID, or
Optional.empty()
if it does not exist.
-
getSenderOrganization
- Specified by:
getSenderOrganization
in interfaceMayHaveSender
- Returns:
- the sender organization, or
Optional.empty()
if it does not exist.
-
toString
-