Package com.verisign.epp.codec.contact

## Class EPPContactPostalDefinition

- java.lang.Object
- - com.verisign.epp.codec.contact.EPPContactPostalDefinition

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

      public class EPPContactPostalDefinition
      extends java.lang.Object
      implements EPPCodecComponent

  Represents a contact postal address definition that is used in `EPPContactCreateCmd`, `EPPContactUpdateCmd`, and `EPPContactInfoResp`. The child elements associated with an `EPPContactPostalDefinition` include:
  - A <contact:name> element that contains the name of the individual or role represented by the contact. Use `getName` and `setName` to get and set the element.
  - An OPTIONAL <contact:org> element that contains the name of the organization with which the contact is affiliated. Use `getOrg` and `setOrg` to get and set the element.
  - A <contact:addr> element that contains address information associated with the contact. Use `getAddress` and `setAdress` to get and set the element.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static java.lang.String` | `ATTR_TYPE_INT` | Value of the INT in contact postal info type mapping
    `static java.lang.String` | `ATTR_TYPE_LOC` | Value of the LOC in contact postal info type mapping
    `static java.lang.String` | `ELM_NAME_POSTAL_INFO` | XML tag name for the `org` attribute.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `EPPContactPostalDefinition()` | `EPPContactPostalDefinition` default constructor.
    `EPPContactPostalDefinition​(java.lang.String aType)` | `EPPContactPostalDefinition` constructor that takes the contact address type as argument.
    `EPPContactPostalDefinition​(java.lang.String aType, EPPContactAddress aAddress)` | `EPPContactPostalDefinition` constructor that sets the required attributes with the parameters.
    `EPPContactPostalDefinition​(java.lang.String aName, java.lang.String aType, EPPContactAddress aAddress)` | `EPPContactPostalDefinition` constructor that sets the required attributes with the parameters.
    `EPPContactPostalDefinition​(java.lang.String aName, java.lang.String aOrg, java.lang.String aType, EPPContactAddress aAddress)` | `EPPContactPostalDefinition` constructor that sets all of the attribute with the parameter values.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.Object` | `clone()` | Clone `EPPContactPostalDefinition`.
    `void` | `decode​(org.w3c.dom.Element aElement)` | Decode the `EPPContactPostalDefinition` attributes from the aElement DOM Element tree.
    `org.w3c.dom.Element` | `encode​(org.w3c.dom.Document aDocument)` | Encode a DOM Element tree from the attributes of the `EPPContactPostalDefinition` instance.
    `boolean` | `equals​(java.lang.Object aObject)` | implements a deep `EPPContactPostalDefinition` compare.
    `EPPContactAddress` | `getAddress()` | Gets the contact address
    `java.lang.String` | `getName()` | Gets the contact name
    `java.lang.String` | `getNamespace()` | Returns the XML namespace associated with the `EPPCodecComponent`.
    `java.lang.String` | `getOrg()` | Gets the contact organization
    `java.lang.String` | `getRootName()` | Get root tag name for contact postal definition.
    `java.lang.String` | `getType()` | Get contact address type.
    `boolean` | `hasAddress()` | Returns `true` if the postal info defintion has address.
    `boolean` | `hasName()` | Returns `true` if the postal info definition has name.
    `boolean` | `hasOrg()` | Returns `true` if the postal info definition has organization.
    `boolean` | `hasRootName()` | Returns `true` if the postal info definition has root name.
    `boolean` | `hasType()` | Returns `true` if the postal info definition has type.
    `boolean` | `isValidated()` | Show whether needs to call validateState()
    `void` | `setAddress​(EPPContactAddress aAddress)` | Sets the contact address
    `void` | `setName​(java.lang.String aName)` | Sets the contact name.
    `void` | `setOrg​(java.lang.String aOrg)` | Sets the contact organization
    `void` | `setRootName​(java.lang.String newRootName)` | Set root tag name for contact postal definition.
    `void` | `setType​(java.lang.String newType)` | Set contact type.
    `void` | `setValidatedFlag​(boolean newValidatedFlag)` | Set validated flag.
    `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_NAME_POSTAL_INFO

          public static final java.lang.String ELM_NAME_POSTAL_INFO

      XML tag name for the `org` attribute.
      See Also:
        Constant Field Values

    - #### ATTR_TYPE_LOC

          public static final java.lang.String ATTR_TYPE_LOC

      Value of the LOC in contact postal info type mapping
      See Also:
        Constant Field Values

    - #### ATTR_TYPE_INT

          public static final java.lang.String ATTR_TYPE_INT

      Value of the INT in contact postal info type mapping
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### EPPContactPostalDefinition

          public EPPContactPostalDefinition()

      `EPPContactPostalDefinition` default constructor. Must call required setter methods before invoking `encode`, which include:
      - id - `setId`
      - name - `setName`
      - type - `setType`
      - address - `setAddress`
      - voice - `setVoice`
      - email - `setEmail`
      The following optional attributes can be set:
      - org - `setOrg`
      - fax - `setFax`

    - #### EPPContactPostalDefinition

          public EPPContactPostalDefinition​(java.lang.String aType)

      `EPPContactPostalDefinition` constructor that takes the contact address type as argument.
      Parameters:
        `aType` - address type which should be one of the `ATTR_TYPE` constants.

    - #### EPPContactPostalDefinition

          public EPPContactPostalDefinition​(java.lang.String aType,
                                            EPPContactAddress aAddress)

      `EPPContactPostalDefinition` constructor that sets the required attributes with the parameters. The following optional attribute can be set:
      - org - `setOrg`
      - fax - `setFax`
      - name - `setName`
      Parameters:
        `aType` - postal definition type loc or int
        `aAddress` - contact address

    - #### EPPContactPostalDefinition

          public EPPContactPostalDefinition​(java.lang.String aName,
                                            java.lang.String aType,
                                            EPPContactAddress aAddress)

      `EPPContactPostalDefinition` constructor that sets the required attributes with the parameters. The following optional attribute can be set:
      - org - `setOrg`
      - fax - `setFax`
      Parameters:
        `aName` - contact name
        `aType` - postal definition type loc or int
        `aAddress` - contact address

    - #### EPPContactPostalDefinition

          public EPPContactPostalDefinition​(java.lang.String aName,
                                            java.lang.String aOrg,
                                            java.lang.String aType,
                                            EPPContactAddress aAddress)

      `EPPContactPostalDefinition` constructor that sets all of the attribute with the parameter values.
      Parameters:
        `aName` - contact name
        `aOrg` - contact organization if defined; `null` otherwise
        `aType` - postal definition type loc or int
        `aAddress` - contact address

  - ### Method Detail

    - #### getOrg

          public java.lang.String getOrg()

      Gets the contact organization
      Returns:
        Client organization if defined; `null` otherwise.

    - #### hasOrg

          public boolean hasOrg()

      Returns `true` if the postal info definition has organization.
      Returns:
        `true` if the postal info definition has organization `false` otherwise

    - #### setOrg

          public void setOrg​(java.lang.String aOrg)

      Sets the contact organization
      Parameters:
        `aOrg` - Client organization

    - #### getAddress

          public EPPContactAddress getAddress()

      Gets the contact address
      Returns:
        Contact address if defined; `null` otherwise.

    - #### hasAddress

          public boolean hasAddress()

      Returns `true` if the postal info defintion has address.
      Returns:
        `true` if the postal info definition has address `false` otherwise

    - #### setAddress

          public void setAddress​(EPPContactAddress aAddress)

      Sets the contact address
      Parameters:
        `aAddress` - Contact address

    - #### encode

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

      Encode a DOM Element tree from the attributes of the `EPPContactPostalDefinition` instance.
      Specified by:
        `encode` in interface `EPPCodecComponent`
      Parameters:
        `aDocument` - DOM Document that is being built. Used as an Element factory.
      Returns:
        Element
      Throws:
        `EPPEncodeException` - On encoding error

    - #### decode

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

      Decode the `EPPContactPostalDefinition` attributes from the aElement DOM Element tree.
      Specified by:
        `decode` in interface `EPPCodecComponent`
      Parameters:
        `aElement` - Root DOM Element to decode `EPPContactPostalDefinition` from.
      Throws:
        `EPPDecodeException` - On decoding error

    - #### equals

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

      implements a deep `EPPContactPostalDefinition` compare.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `aObject` - `EPPContactPostalDefinition` instance to compare with
      Returns:
        `true` if objects are equal otherwise `false`

    - #### clone

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

      Clone `EPPContactPostalDefinition`.
      Specified by:
        `clone` in interface `EPPCodecComponent`
      Overrides:
        `clone` in class `java.lang.Object`
      Returns:
        clone of `EPPContactPostalDefinition`
      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.

    - #### getName

          public java.lang.String getName()

      Gets the contact name
      Returns:
        Contact Name if defined; `null` otherwise.

    - #### hasName

          public boolean hasName()

      Returns `true` if the postal info definition has name.
      Returns:
        `true` if the postal info definition has name `false` otherwise

    - #### getRootName

          public java.lang.String getRootName()

      Get root tag name for contact postal definition.
      Returns:
        String root tag name

    - #### hasRootName

          public boolean hasRootName()

      Returns `true` if the postal info definition has root name.
      Returns:
        `true` if the postal info definition has root name `false` otherwise

    - #### setName

          public void setName​(java.lang.String aName)

      Sets the contact name.
      Parameters:
        `aName` - Contact Name

    - #### setRootName

          public void setRootName​(java.lang.String newRootName)

      Set root tag name for contact postal definition.
      Parameters:
        `newRootName` - String

    - #### isValidated

          public boolean isValidated()

      Show whether needs to call validateState()
      Returns:
        boolean

    - #### setValidatedFlag

          public void setValidatedFlag​(boolean newValidatedFlag)

      Set validated flag.
      Parameters:
        `newValidatedFlag` - boolean

    - #### getType

          public java.lang.String getType()

      Get contact address type.
      Returns:
        String Contact type

    - #### hasType

          public boolean hasType()

      Returns `true` if the postal info definition has type.
      Returns:
        `true` if the postal info definition has type `false` otherwise

    - #### setType

          public void setType​(java.lang.String newType)

      Set contact type.
      Parameters:
        `newType` - String

    - #### 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`.