java.lang.Object
no.digipost.api.client.representations.Message
All Implemented Interfaces:
MayHaveSender

public class Message extends Object implements MayHaveSender
  • Field Details

  • Method Details

    • newMessage

      public static Message.MessageBuilder newMessage(UUID messageId, Document primaryDocument)
    • newMessage

      public static Message.MessageBuilder newMessage(String messageId, Document primaryDocument)
    • copyPrintMessage

      public static Message copyPrintMessage(Message messageToCopy)
      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

      public static Message copyMessageWithOnlyDigipostDetails(Message messageToCopy)
    • getAllDocuments

      public Stream<Document> 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

      public boolean isSameMessageAs(Message message)
    • hasAnyDocumentRequiringEncryption

      public boolean hasAnyDocumentRequiringEncryption()
    • getChannel

      public Channel getChannel()
    • documentOrder

      public Comparator<? super Document> documentOrder()
      Returns:
      Comparator which order documents by the same order as they are contained in this message. If a document
    • getSenderId

      public Optional<SenderId> getSenderId()
      Specified by:
      getSenderId in interface MayHaveSender
      Returns:
      the sender ID, or Optional.empty() if it does not exist.
    • getSenderOrganization

      public Optional<SenderOrganization> getSenderOrganization()
      Specified by:
      getSenderOrganization in interface MayHaveSender
      Returns:
      the sender organization, or Optional.empty() if it does not exist.
    • toString

      public String toString()
      Overrides:
      toString in class Object