Class EPPOrgAddress

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

public class EPPOrgAddress extends Object implements EPPCodecComponent
Represents a org address. Every org 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 org address is defined as the following:

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

  • OPTIONAL <org:street> elements (up to a maximum of three) that contain the org's street address. Use getStreets() and setStreets(List) to get and set the elements.
  • A <org:city> element that contains the org's city. Use getCity() and setCity(String) to get and set the element.
  • A <org:sp> element that contains the org'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 <org:pc> element that contains the org's postal code. Use getPostalCode() and setPostalCode(String) to get and set the element.
  • A <org:cc> element that contains the two-character identifier representing with the org's country. Use getCountry() and setCountry(String) to get and set the element.
See Also:
  • Field Details

  • Constructor Details

    • EPPOrgAddress

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

    • EPPOrgAddress

      public EPPOrgAddress(String aCity, String aCountry)
      Constructor for EPPOrgAddress all of the required attributes as parameters.
      Parameters:
      aCity - Org street
      aCountry - Org country
    • EPPOrgAddress

      public EPPOrgAddress(List<String> aStreets, String aCity, String aStateProvince, String aPostalCode, String aCountry)
      Constructor for EPPOrgAddress all of the attributes as parameters.
      Parameters:
      aStreets - List<String> collection of streets (up to maximum three)
      aCity - Org street
      aStateProvince - Org state/province
      aPostalCode - Org postal code
      aCountry - Org country
  • Method Details

    • 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(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 List<String> getStreets()
      Gets the org street(s).
      Returns:
      street(s) as a List<String> of streets (up to maximum three).
    • setStreets

      public void setStreets(List<String> aStreets)
      Sets the org streets attribute with a List>String>, where each element represents a line of the street address.
      Parameters:
      aStreets - Up to 3 street elements
    • setStreet

      public void setStreet(String aStreet)
      Sets the org streets with only one line. Only a one element List<String> will be returned on a call to getStreets() after calling this method.
      Parameters:
      aStreet - Org street.
    • setStreets

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

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

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

      public void setCity(String aCity)
      Sets the org city.
      Parameters:
      aCity - org city
    • getStateProvince

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

      public void setStateProvince(String aStateProvince)
      Sets the org state/province.
      Parameters:
      aStateProvince - org state/province
    • getPostalCode

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

      public void setPostalCode(String aPostalCode)
      Sets the org postal code
      Parameters:
      aPostalCode - org postal code
    • getCountry

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

      public void setCountry(String aCountry)
      Sets the org country.
      Parameters:
      aCountry - org country
    • encode

      public Element encode(Document aDocument) throws EPPEncodeException
      Encode a DOM Element tree from the attributes of the EPPOrgAddress 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 EPPOrgAddress instance.
      Throws:
      EPPEncodeException - Unable to encode EPPOrgAddress instance.
    • decode

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

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

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

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