io.vertx.ext.mail

## Class MailAttachment

- java.lang.Object
- - io.vertx.ext.mail.MailAttachment

-     public class MailAttachment
      extends Object

  Represent a mail attachment that can be used in a MailMessage.
  Author:
    Alexander Lehmann

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MailAttachment()` construct an empty MailAttachment object that can be filled with the setters
    `MailAttachment(JsonObject json)` create a MailAttachment object from a JsonObject representation
    `MailAttachment(MailAttachment other)` create a copy of a MailAttachment object

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `MailAttachment` | `addHeader(String key, String value)` Add an header to this attachment.
    `boolean` | `equals(Object o)`
    `String` | `getContentId()` get the Content-ID field
    `String` | `getContentType()` get the Content-Type
    `Buffer` | `getData()` get the data
    `String` | `getDescription()` get the description field
    `String` | `getDisposition()` get the disposition field
    `MultiMap` | `getHeaders()` Get the headers to be added for this attachment.
    `String` | `getName()` get the name
    `int` | `hashCode()`
    `MailAttachment` | `setContentId(String contentId)` set the Content-ID field to be used in the attachment
    `MailAttachment` | `setContentType(String contentType)` set the Content-Type
    `MailAttachment` | `setData(Buffer data)` set the data
    `MailAttachment` | `setDescription(String description)` set the description field to be used in the attachment
    `MailAttachment` | `setDisposition(String disposition)` set the disposition field to be used in the attachment
    `MailAttachment` | `setHeaders(MultiMap headers)` Set the headers to be added for this attachment.
    `MailAttachment` | `setName(String name)` set the name
    `JsonObject` | `toJson()` convert this object to JSON representation

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MailAttachment

          public MailAttachment()

      construct an empty MailAttachment object that can be filled with the setters

    - #### MailAttachment

          public MailAttachment(MailAttachment other)

      create a copy of a MailAttachment object
      Parameters:
        `other` - object to be copied

    - #### MailAttachment

          public MailAttachment(JsonObject json)

      create a MailAttachment object from a JsonObject representation
      Parameters:
        `json` - object to be copied

  - ### Method Detail

    - #### getData

          public Buffer getData()

      get the data
      Returns:
        the data

    - #### setData

          public MailAttachment setData(Buffer data)

      set the data
      Parameters:
        `data` - Buffer of bytes to be used at attachment
      Returns:
        this to be able to use it fluently

    - #### getName

          public String getName()

      get the name
      Returns:
        the name

    - #### setName

          public MailAttachment setName(String name)

      set the name
      Parameters:
        `name` - name of the attachment file
      Returns:
        this to be able to use it fluently

        name is the descriptive filename that will be put into the mail i.e. usually a local filename without path this can be set to "" to omit the filename attribute

    - #### getContentType

          public String getContentType()

      get the Content-Type
      Returns:
        the contentType

    - #### setContentType

          public MailAttachment setContentType(String contentType)

      set the Content-Type
      Parameters:
        `contentType` - the contentType
      Returns:
        this to be able to use it fluently

    - #### getDisposition

          public String getDisposition()

      get the disposition field
      Returns:
        the disposition

    - #### setDisposition

          public MailAttachment setDisposition(String disposition)

      set the disposition field to be used in the attachment
      Parameters:
        `disposition` - the disposition
      Returns:
        this to be able to use it fluently

    - #### getDescription

          public String getDescription()

      get the description field
      Returns:
        the description

    - #### setDescription

          public MailAttachment setDescription(String description)

      set the description field to be used in the attachment
      Parameters:
        `description` - the description
      Returns:
        this to be able to use it fluently

    - #### getContentId

          public String getContentId()

      get the Content-ID field
      Returns:
        the content id

    - #### setContentId

          public MailAttachment setContentId(String contentId)

      set the Content-ID field to be used in the attachment
      Parameters:
        `contentId` - the content id
      Returns:
        this to be able to use it fluently

    - #### addHeader

          public MailAttachment addHeader(String key,
                                          String value)

      Add an header to this attachment.
      Parameters:
        `key` - the header key
        `value` - the header value
      Returns:
        a reference to this, so the API can be used fluently

    - #### getHeaders

          public MultiMap getHeaders()

      Get the headers to be added for this attachment.
      Returns:
        the headers

    - #### setHeaders

          public MailAttachment setHeaders(MultiMap headers)

      Set the headers to be added for this attachment.
      Parameters:
        `headers` - the headers to be added
      Returns:
        this to be able to use it fluently

    - #### toJson

          public JsonObject toJson()

      convert this object to JSON representation
      Returns:
        the JSON object

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2017. All rights reserved.