Class EPPContactPostalDefinition

java.lang.Object
com.verisign.epp.codec.contact.EPPContactPostalDefinition
All Implemented Interfaces:
EPPCodecComponent, Serializable, Cloneable

public class EPPContactPostalDefinition extends 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:
  • Field Details

    • ELM_NAME_POSTAL_INFO

      public static final String ELM_NAME_POSTAL_INFO
      XML tag name for the org attribute.
      See Also:
    • ATTR_TYPE_LOC

      public static final String ATTR_TYPE_LOC
      Value of the LOC in contact postal info type mapping
      See Also:
    • ATTR_TYPE_INT

      public static final String ATTR_TYPE_INT
      Value of the INT in contact postal info type mapping
      See Also:
  • Constructor Details

    • 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(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(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(String aName, 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(String aName, String aOrg, 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 Details

    • getOrg

      public 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(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 Element encode(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(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(Object aObject)
      implements a deep EPPContactPostalDefinition compare.
      Overrides:
      equals in class Object
      Parameters:
      aObject - EPPContactPostalDefinition instance to compare with
      Returns:
      true if objects are equal otherwise false
    • clone

      public Object clone() throws CloneNotSupportedException
      Clone EPPContactPostalDefinition.
      Specified by:
      clone in interface EPPCodecComponent
      Overrides:
      clone in class Object
      Returns:
      clone of EPPContactPostalDefinition
      Throws:
      CloneNotSupportedException - standard Object.clone exception
    • toString

      public String toString()
      Implementation of Object.toString, which will result in an indented XML String representation of the concrete EPPCodecComponent.
      Overrides:
      toString in class Object
      Returns:
      Indented XML String if successful; ERROR otherwise.
    • getName

      public 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 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(String aName)
      Sets the contact name.
      Parameters:
      aName - Contact Name
    • setRootName

      public void setRootName(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 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(String newType)
      Set contact type.
      Parameters:
      newType - String
    • getNamespace

      public String getNamespace()
      Returns the XML namespace associated with the EPPCodecComponent.
      Specified by:
      getNamespace in interface EPPCodecComponent
      Returns:
      XML namespace for the EPPCodecComponent.