Class BodyPart

  • Direct Known Subclasses:
    AttachmentPart

    public class BodyPart
    extends Object
    Body part representation holds content as String and optional attachment parts.
    Since:
    1.4
    Author:
    Christoph Deppisch
    • Constructor Detail

      • BodyPart

        public BodyPart()
        Default constructor.
      • BodyPart

        public BodyPart​(String content,
                        String contentType)
        Default constructor using content and contentType.
        Parameters:
        content -
        contentType -
    • Method Detail

      • addPart

        public void addPart​(AttachmentPart part)
        Adds new attachment part.
        Parameters:
        part -
      • getContentType

        public String getContentType()
        Gets the content type.
        Returns:
      • setContentType

        public void setContentType​(String contentType)
        Sets the content type.
        Parameters:
        contentType -
      • getContent

        public String getContent()
        Gets the content as string.
        Returns:
      • setContent

        public void setContent​(String content)
        Sets the content as string.
        Parameters:
        content -
      • setAttachments

        public void setAttachments​(BodyPart.Attachments attachments)
        Sets the attachment list.
        Parameters:
        attachments -
      • hasAttachments

        public boolean hasAttachments()
        Checks if attachments are present.
        Returns: