Package com.verisign.epp.codec.contact
Class EPPContactAddress
- java.lang.Object
-
- com.verisign.epp.codec.contact.EPPContactAddress
-
- All Implemented Interfaces:
EPPCodecComponent,java.io.Serializable,java.lang.Cloneable
public class EPPContactAddress extends java.lang.Object implements EPPCodecComponent
Represents a contact address specified inEPPContactCreateCmd,EPPContactUpdateCmd, orEPPContactInfoResp. 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 in the EPP Contact Mapping Specification:
A <contact:addr> element that contains address information associated with the contact. A <contact:addr> element contains the following child elements:
- OPTIONAL <contact:street> elements (up to a maximum of three) that contain the contact's street address.
Use
getStreetsandsetStreetsto get and set the elements. - A <contact:city> element that contains the contact's city. Use
getCityandsetCityto get and set the element. - A <contact: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
getStateProvinceandsetStateProvinceto get and set the element. - An OPTIONAL <contact:pc> element that contains the contact's postal code. Use
getPostalCodeandsetPostalCodeto get and set the element. - A <contact:cc> element that contains the two-character identifier representing with the contact's country.
Use
getCountryandsetCountryto get and set the element.
-
-
Constructor Summary
Constructors Constructor Description EPPContactAddress()Default constructor forEPPContactAddress.EPPContactAddress(java.lang.String aCity, java.lang.String aCountry)Constructor forEPPContactAddressall of the required attributes as parameters.EPPContactAddress(java.util.Vector someStreets, java.lang.String aCity, java.lang.String aStateProvince, java.lang.String aPostalCode, java.lang.String aCountry)Constructor forEPPContactAddressall of the required attributes as parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()CloneEPPContactAddress.voiddecode(org.w3c.dom.Element aElement)Decode theEPPContactAddressattributes from the aElement DOM Element tree.org.w3c.dom.Elementencode(org.w3c.dom.Document aDocument)Encode a DOM Element tree from the attributes of theEPPContactAddressinstance.booleanequals(java.lang.Object aObject)implements a deepEPPContactAddresscompare.java.lang.StringgetCity()Gets the contact city.java.lang.StringgetCountry()Gets the contact country.java.lang.StringgetNamespace()Returns the XML namespace associated with theEPPCodecComponent.java.lang.StringgetPostalCode()Gets the contact postal codejava.lang.StringgetStateProvince()Gets the contact state/province.java.util.VectorgetStreets()Gets the contact street(s).booleanhasCity()Returnstrueif the address has city.booleanhasCountry()Returnstrueif the address has country.booleanhasPostalCode()Returnstrueif the address has postal code.booleanhasStateProvince()Returnstrueif the address has state.booleanhasStreets()Returnstrueif the address has at least one street.voidsetCity(java.lang.String aCity)Sets the contact city.voidsetCountry(java.lang.String aCountry)Sets the contact country.voidsetPostalCode(java.lang.String aPostalCode)Sets the contact postal codevoidsetStateProvince(java.lang.String aStateProvince)Sets the contact state/province.voidsetStreet(java.lang.String aStreet)Sets the contact street with only oneStringparameter.voidsetStreets(java.lang.String aStreet1, java.lang.String aStreet2)Sets the contact street with two sub-streetString's.voidsetStreets(java.lang.String aStreet1, java.lang.String aStreet2, java.lang.String aStreet3)Sets the contact street with three sub-streetString's.voidsetStreets(java.util.Vector someStreets)Sets the contact street attribute with aVectorofString's.java.lang.StringtoString()Implementation oftoString, which will result in an indented XMLStringrepresentation of the concreteEPPCodecComponent.
-
-
-
Constructor Detail
-
EPPContactAddress
public EPPContactAddress()
Default constructor forEPPContactAddress. All the the attributes default tonull. Must call required setter methods before invokingencode, which include:
- city -
setCity - country -
setCountry
- city -
-
EPPContactAddress
public EPPContactAddress(java.lang.String aCity, java.lang.String aCountry)Constructor forEPPContactAddressall of the required attributes as parameters.- Parameters:
aCity- contact streetaCountry- contract country
-
EPPContactAddress
public EPPContactAddress(java.util.Vector someStreets, java.lang.String aCity, java.lang.String aStateProvince, java.lang.String aPostalCode, java.lang.String aCountry)Constructor forEPPContactAddressall of the required attributes as parameters.- Parameters:
someStreets-Vectorof street (up to maximum three)String'saCity- contact streetaStateProvince- contact state/provinceaPostalCode- contact postal codeaCountry- contract country
-
-
Method Detail
-
getStreets
public java.util.Vector getStreets()
Gets the contact street(s).- Returns:
- street(s) as a
Vectorof street (up to maximum three)Stringif defined;nullotherwise.
-
hasStreets
public boolean hasStreets()
Returnstrueif the address has at least one street.- Returns:
trueif the address at least one streetfalseotherwise
-
setStreet
public void setStreet(java.lang.String aStreet)
Sets the contact street with only oneStringparameter. Only a one elementVectorwill be returned on a call togetStreetswhen originally set with this method.- Parameters:
aStreet- contact street.
-
setStreets
public void setStreets(java.util.Vector someStreets)
Sets the contact street attribute with aVectorofString's.- Parameters:
someStreets-Vectorof one or two streetString's.
-
setStreets
public void setStreets(java.lang.String aStreet1, java.lang.String aStreet2)Sets the contact street with two sub-streetString's.- Parameters:
aStreet1- First part/line of contact streetaStreet2- Second part/line of contact street
-
setStreets
public void setStreets(java.lang.String aStreet1, java.lang.String aStreet2, java.lang.String aStreet3)Sets the contact street with three sub-streetString's.- Parameters:
aStreet1- First part/line of contact streetaStreet2- Second part/line of contact streetaStreet3- Third part/line of contact street
-
getCity
public java.lang.String getCity()
Gets the contact city.- Returns:
- city.
Stringif defined;nullotherwise.
-
hasCity
public boolean hasCity()
Returnstrueif the address has city.- Returns:
trueif the address has cityfalseotherwise
-
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.
Stringif defined;nullotherwise.
-
hasStateProvince
public boolean hasStateProvince()
Returnstrueif the address has state.- Returns:
trueif the address has statefalseotherwise
-
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
Stringif defined;nullotherwise.
-
hasPostalCode
public boolean hasPostalCode()
Returnstrueif the address has postal code.- Returns:
trueif the address has postal codefalseotherwise
-
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
Stringif defined;nullotherwise.
-
hasCountry
public boolean hasCountry()
Returnstrueif the address has country.- Returns:
trueif the address has countryfalseotherwise
-
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 EPPEncodeExceptionEncode a DOM Element tree from the attributes of theEPPContactAddressinstance.- Specified by:
encodein interfaceEPPCodecComponent- Parameters:
aDocument- DOM Document that is being built. Used as an Element factory.- Returns:
- Root DOM Element representing the
EPPContactAddressinstance. - Throws:
EPPEncodeException- Unable to encodeEPPContactAddressinstance.
-
decode
public void decode(org.w3c.dom.Element aElement) throws EPPDecodeExceptionDecode theEPPContactAddressattributes from the aElement DOM Element tree.- Specified by:
decodein interfaceEPPCodecComponent- Parameters:
aElement- Root DOM Element to decodeEPPContactAddressfrom.- Throws:
EPPDecodeException- Unable to decode aElement.
-
equals
public boolean equals(java.lang.Object aObject)
implements a deepEPPContactAddresscompare.- Overrides:
equalsin classjava.lang.Object- Parameters:
aObject-EPPContactAddressinstance to compare with- Returns:
- boolean
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionCloneEPPContactAddress.- Specified by:
clonein interfaceEPPCodecComponent- Overrides:
clonein classjava.lang.Object- Returns:
- clone of
EPPContactAddress - Throws:
java.lang.CloneNotSupportedException- standard Object.clone exception
-
toString
public java.lang.String toString()
Implementation oftoString, which will result in an indented XMLStringrepresentation of the concreteEPPCodecComponent.- Overrides:
toStringin classjava.lang.Object- Returns:
- Indented XML
Stringif successful;ERRORotherwise.
-
getNamespace
public java.lang.String getNamespace()
Returns the XML namespace associated with theEPPCodecComponent.- Specified by:
getNamespacein interfaceEPPCodecComponent- Returns:
- XML namespace for the
EPPCodecComponent.
-
-