Package com.verisign.epp.codec.addlemail

## Class EPPAddlEmail

- java.lang.Object
- - com.verisign.epp.codec.addlemail.EPPAddlEmail

- All Implemented Interfaces:
    `EPPCodecComponent`, `java.io.Serializable`, `java.lang.Cloneable`

      public class EPPAddlEmail
      extends java.lang.Object
      implements EPPCodecComponent

  A second email can be set using the `EPPEAIEmail` extension with the option for defining the "primary" attribute to indicate that the extension email should be treated as the primary email address.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static java.lang.String` | `ELM_LOCALNAME` | XML local name for `EPPEAIEmail`.
    `static java.lang.String` | `ELM_NAME` | XML root tag for `EPPEAIEmail`.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `EPPAddlEmail()` | Default constructor for `EPPEAIEmail`.
    `EPPAddlEmail​(java.lang.String aEmail)` | Constructor for `EPPEAIEmail` that takes the second email value.
    `EPPAddlEmail​(java.lang.String aEmail, boolean aPrimary)` | Constructor for `EPPEAIEmail` that takes the second email value.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.Object` | `clone()` | clone an `EPPCodecComponent`.
    `void` | `decode​(org.w3c.dom.Element aElement)` | decode a DOM element tree to initialize the instance attributes.
    `org.w3c.dom.Element` | `encode​(org.w3c.dom.Document aDocument)` | encode instance into a DOM element tree.
    `boolean` | `equals​(java.lang.Object aObject)` | Compare an instance of `EPPEAIEmail` with this instance.
    `java.lang.String` | `getEmail()` | Gets the second email value.
    `java.lang.String` | `getNamespace()` | Returns the XML namespace associated with the `EPPCodecComponent`.
    `boolean` | `hasEmail()` | Is the second email defined?
    `boolean` | `isPrimary()` | Is the second email the primary email? The default value is `false`.
    `void` | `setEmail​(java.lang.String aEmail)` | Sets the second email value.
    `void` | `setPrimary​(boolean aPrimary)` | Sets the primary attribute for the second email.
    `java.lang.String` | `toString()` | Implementation of `Object.toString`, which will result in an indented XML `String` representation of the concrete `EPPCodecComponent`.

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

      `finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### ELM_LOCALNAME

          public static final java.lang.String ELM_LOCALNAME

      XML local name for `EPPEAIEmail`.
      See Also:
        Constant Field Values

    - #### ELM_NAME

          public static final java.lang.String ELM_NAME

      XML root tag for `EPPEAIEmail`.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### EPPAddlEmail

          public EPPAddlEmail()

      Default constructor for `EPPEAIEmail`.

    - #### EPPAddlEmail

          public EPPAddlEmail​(java.lang.String aEmail)

      Constructor for `EPPEAIEmail` that takes the second email value.
      Parameters:
        `aEmail` - Second email. Set to `null` to explicitly indicate that there is no second email.

    - #### EPPAddlEmail

          public EPPAddlEmail​(java.lang.String aEmail,
                              boolean aPrimary)

      Constructor for `EPPEAIEmail` that takes the second email value.
      Parameters:
        `aEmail` - Second email. Set to `null` to explicitly indicate that there is no second email.
        `aPrimary` - Is the second email the primary email?

  - ### Method Detail

    - #### hasEmail

          public boolean hasEmail()

      Is the second email defined?
      Returns:
        `true` if the second email is defined; `false` otherwise.

    - #### getEmail

          public java.lang.String getEmail()

      Gets the second email value.
      Returns:
        second email value if defined; `null` otherwise.

    - #### setEmail

          public void setEmail​(java.lang.String aEmail)

      Sets the second email value.
      Parameters:
        `aEmail` - Second email. Set to `null` to explicitly indicate that there is no second email.

    - #### isPrimary

          public boolean isPrimary()

      Is the second email the primary email? The default value is `false`.
      Returns:
        `true` if the second email is the primary email; `false` otherwise.

    - #### setPrimary

          public void setPrimary​(boolean aPrimary)

      Sets the primary attribute for the second email.
      Parameters:
        `aPrimary` - Set to `true` if the second email is the primary email; `false` otherwise.

    - #### encode

          public org.w3c.dom.Element encode​(org.w3c.dom.Document aDocument)
                                     throws EPPEncodeException

      encode instance into a DOM element tree. A DOM Document is passed as an argument and functions as a factory for DOM objects. The root element associated with the instance is created and each instance attribute is appended as a child node.
      Specified by:
        `encode` in interface `EPPCodecComponent`
      Parameters:
        `aDocument` - DOM Document, which acts is an Element factory
      Returns:
        Element Root element associated with the object
      Throws:
        `EPPEncodeException` - Error encoding `EPPEAIEmail`

    - #### decode

          public void decode​(org.w3c.dom.Element aElement)
                      throws EPPDecodeException

      decode a DOM element tree to initialize the instance attributes. The `aElement` argument represents the root DOM element and is used to traverse the DOM nodes for instance attribute values.
      Specified by:
        `decode` in interface `EPPCodecComponent`
      Parameters:
        `aElement` - `Element` to decode
      Throws:
        `EPPDecodeException` - Error decoding `Element`

    - #### clone

          public java.lang.Object clone()
                                 throws java.lang.CloneNotSupportedException

      clone an `EPPCodecComponent`.
      Specified by:
        `clone` in interface `EPPCodecComponent`
      Overrides:
        `clone` in class `java.lang.Object`
      Returns:
        clone of concrete `EPPEAIEmail`
      Throws:
        `java.lang.CloneNotSupportedException` - standard Object.clone exception

    - #### toString

          public java.lang.String toString()

      Implementation of `Object.toString`, which will result in an indented XML `String` representation of the concrete `EPPCodecComponent`.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        Indented XML `String` if successful; `ERROR` otherwise.

    - #### equals

          public boolean equals​(java.lang.Object aObject)

      Compare an instance of `EPPEAIEmail` with this instance.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `aObject` - Object to compare with.
      Returns:
        `true` if equal; `false` otherwise.

    - #### getNamespace

          public java.lang.String getNamespace()

      Returns the XML namespace associated with the `EPPCodecComponent`.
      Specified by:
        `getNamespace` in interface `EPPCodecComponent`
      Returns:
        XML namespace for the `EPPCodecComponent`.