Class EPPValidateAddress

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

    public class EPPValidateAddress
    extends java.lang.Object
    implements EPPCodecComponent
    Represents a contact address. Every contact has associated postal address information. A postal address contains OPTIONAL street information, city information, OPTIONAL state/province information, an OPTIONAL postal code, and a country identifier as described in [ISO11180]. Address information MAY be provided in both a subset of UTF-8 [RFC2279] that can be represented in 7-bit ASCII [US-ASCII] and unrestricted UTF-8. A contact address is defined as the following:

    A <validate:addr> element that contains address information associated with the contact. A <validate:addr> element contains the following child elements:

    • OPTIONAL <validate:street> elements (up to a maximum of three) that contain the contact's street address. Use getStreets() and setStreets(List) to get and set the elements.
    • A <validate:city> element that contains the contact's city. Use getCity() and setCity(String) to get and set the element.
    • A <validate:sp> element that contains the contact's state or province. This element is OPTIONAL for addressing schemes that do not require a state or province name. Use getStateProvince() and setStateProvince(String) to get and set the element.
    • An OPTIONAL <validate:pc> element that contains the contact's postal code. Use getPostalCode() and setPostalCode(String) to get and set the element.
    • A <validate:cc> element that contains the two-character identifier representing with the contact's country. Use getCountry() and setCountry(String) to get and set the element.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ELM_LOCALNAME
      XML local name for EPPValidateAddress.
      static java.lang.String ELM_NAME
      XML root tag for EPPValidatePostalDefinition.
    • Constructor Summary

      Constructors 
      Constructor Description
      EPPValidateAddress()
      Default constructor for EPPValidateAddress.
      EPPValidateAddress​(java.lang.String aCity, java.lang.String aCountry)
      Constructor for EPPValidateAddress all of the required attributes as parameters.
      EPPValidateAddress​(java.util.List<java.lang.String> aStreets, java.lang.String aCity, java.lang.String aStateProvince, java.lang.String aPostalCode, java.lang.String aCountry)
      Constructor for EPPValidateAddress all of the attributes as parameters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addStreet​(java.lang.String aStreetLine)
      Add a street line to the street.
      java.lang.Object clone()
      Clone EPPValidateAddress.
      void decode​(org.w3c.dom.Element aElement)
      Decode the EPPValidateAddress 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 EPPValidateAddress instance.
      boolean equals​(java.lang.Object aObject)
      implements a deep EPPValidateAddress compare.
      java.lang.String getCity()
      Gets the contact city.
      java.lang.String getCountry()
      Gets the contact country.
      java.lang.String getNamespace()
      Returns the XML namespace associated with the EPPCodecComponent.
      java.lang.String getPostalCode()
      Gets the contact postal code
      java.lang.String getStateProvince()
      Gets the contact state/province.
      java.util.List<java.lang.String> getStreets()
      Gets the contact street(s).
      boolean hasStreets()
      Is there any street lines set?
      void setCity​(java.lang.String aCity)
      Sets the contact city.
      void setCountry​(java.lang.String aCountry)
      Sets the contact country.
      void setPostalCode​(java.lang.String aPostalCode)
      Sets the contact postal code
      void setStateProvince​(java.lang.String aStateProvince)
      Sets the contact state/province.
      void setStreet​(java.lang.String aStreet)
      Sets the contact streets with only one line.
      void setStreets​(java.lang.String aStreet1, java.lang.String aStreet2)
      Sets the contact street with two street lines.
      void setStreets​(java.lang.String aStreet1, java.lang.String aStreet2, java.lang.String aStreet3)
      Sets the contact street with three street lines.
      void setStreets​(java.util.List<java.lang.String> aStreets)
      Sets the contact streets attribute with a List&gt;String&gt;, where each element represents a line of the street address.
      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 EPPValidateAddress.
        See Also:
        Constant Field Values
      • ELM_NAME

        public static final java.lang.String ELM_NAME
        XML root tag for EPPValidatePostalDefinition.
        See Also:
        Constant Field Values
    • Constructor Detail

      • EPPValidateAddress

        public EPPValidateAddress()
        Default constructor for EPPValidateAddress. All the the attributes default to null. Must call required setter methods before invoking encode(Document), which include:

      • EPPValidateAddress

        public EPPValidateAddress​(java.lang.String aCity,
                                  java.lang.String aCountry)
        Constructor for EPPValidateAddress all of the required attributes as parameters.
        Parameters:
        aCity - Contact street
        aCountry - Contact country
      • EPPValidateAddress

        public EPPValidateAddress​(java.util.List<java.lang.String> aStreets,
                                  java.lang.String aCity,
                                  java.lang.String aStateProvince,
                                  java.lang.String aPostalCode,
                                  java.lang.String aCountry)
        Constructor for EPPValidateAddress all of the attributes as parameters.
        Parameters:
        aStreets - List&lt;String&gt; collection of streets (up to maximum three)
        aCity - Contact street
        aStateProvince - Contact state/province
        aPostalCode - Contact postal code
        aCountry - Contact country
    • Method Detail

      • hasStreets

        public boolean hasStreets()
        Is there any street lines set?
        Returns:
        true if there is at least one street line set.
      • addStreet

        public void addStreet​(java.lang.String aStreetLine)
        Add a street line to the street. This will add aStreetLine to the list of street lines.
        Parameters:
        aStreetLine - Street line to add to the street
      • getStreets

        public java.util.List<java.lang.String> getStreets()
        Gets the contact street(s).
        Returns:
        street(s) as a List&lt;String&gt; of streets (up to maximum three).
      • setStreets

        public void setStreets​(java.util.List<java.lang.String> aStreets)
        Sets the contact streets attribute with a List&gt;String&gt;, where each element represents a line of the street address.
        Parameters:
        aStreets - Up to 3 street elements
      • setStreet

        public void setStreet​(java.lang.String aStreet)
        Sets the contact streets with only one line. Only a one element List&lt;String&gt; will be returned on a call to getStreets() after calling this method.
        Parameters:
        aStreet - Contact street.
      • setStreets

        public void setStreets​(java.lang.String aStreet1,
                               java.lang.String aStreet2)
        Sets the contact street with two street lines.
        Parameters:
        aStreet1 - First street line
        aStreet2 - Second street line
      • setStreets

        public void setStreets​(java.lang.String aStreet1,
                               java.lang.String aStreet2,
                               java.lang.String aStreet3)
        Sets the contact street with three street lines.
        Parameters:
        aStreet1 - First street line
        aStreet2 - Second street line
        aStreet3 - Third street line
      • getCity

        public java.lang.String getCity()
        Gets the contact city.
        Returns:
        city. String if defined; null otherwise.
      • setCity

        public void setCity​(java.lang.String aCity)
        Sets the contact city.
        Parameters:
        aCity - contact city
      • getStateProvince

        public java.lang.String getStateProvince()
        Gets the contact state/province.
        Returns:
        state/province. String if defined; null otherwise.
      • setStateProvince

        public void setStateProvince​(java.lang.String aStateProvince)
        Sets the contact state/province.
        Parameters:
        aStateProvince - contact state/province
      • getPostalCode

        public java.lang.String getPostalCode()
        Gets the contact postal code
        Returns:
        postal code String if defined; null otherwise.
      • setPostalCode

        public void setPostalCode​(java.lang.String aPostalCode)
        Sets the contact postal code
        Parameters:
        aPostalCode - contact postal code
      • getCountry

        public java.lang.String getCountry()
        Gets the contact country.
        Returns:
        contact country String if defined; null otherwise.
      • setCountry

        public void setCountry​(java.lang.String aCountry)
        Sets the contact country.
        Parameters:
        aCountry - contact country
      • encode

        public org.w3c.dom.Element encode​(org.w3c.dom.Document aDocument)
                                   throws EPPEncodeException
        Encode a DOM Element tree from the attributes of the EPPValidateAddress instance.
        Specified by:
        encode in interface EPPCodecComponent
        Parameters:
        aDocument - DOM Document that is being built. Used as an Element factory.
        Returns:
        Root DOM Element representing the EPPValidateAddress instance.
        Throws:
        EPPEncodeException - Unable to encode EPPValidateAddress instance.
      • decode

        public void decode​(org.w3c.dom.Element aElement)
                    throws EPPDecodeException
        Decode the EPPValidateAddress attributes from the aElement DOM Element tree.
        Specified by:
        decode in interface EPPCodecComponent
        Parameters:
        aElement - Root DOM Element to decode EPPValidateAddress from.
        Throws:
        EPPDecodeException - Unable to decode aElement.
      • equals

        public boolean equals​(java.lang.Object aObject)
        implements a deep EPPValidateAddress compare.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        aObject - EPPValidateAddress instance to compare with
        Returns:
        true of aObject is equal to instance; false otherwise.
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Clone EPPValidateAddress.
        Specified by:
        clone in interface EPPCodecComponent
        Overrides:
        clone in class java.lang.Object
        Returns:
        clone of EPPValidateAddress
        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.
      • 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.