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
    --- | ---
    `boolean` | `equals(Object o)`
    `String` | `getContentType()` get the Content-Type
    `Buffer` | `getData()` get the data
    `String` | `getDescription()` get the description field
    `String` | `getDisposition()` get the disposition field
    `String` | `getName()` get the name
    `int` | `hashCode()`
    `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` | `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

    - #### 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 © 2015. All Rights Reserved.