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 inEPPContactCreateCmd
,EPPContactUpdateCmd
, andEPPContactInfoResp
. The child elements associated with anEPPContactPostalDefinition
include:
- A <contact:name> element that contains the name of the individual or role represented by the contact. Use
getName
andsetName
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
andsetOrg
to get and set the element. - A <contact:addr> element that contains address information associated with the contact. Use
getAddress
andsetAdress
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 mappingstatic java.lang.String
ATTR_TYPE_LOC
Value of the LOC in contact postal info type mappingstatic java.lang.String
ELM_NAME_POSTAL_INFO
XML tag name for theorg
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()
CloneEPPContactPostalDefinition
.void
decode(org.w3c.dom.Element aElement)
Decode theEPPContactPostalDefinition
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 theEPPContactPostalDefinition
instance.boolean
equals(java.lang.Object aObject)
implements a deepEPPContactPostalDefinition
compare.EPPContactAddress
getAddress()
Gets the contact addressjava.lang.String
getName()
Gets the contact namejava.lang.String
getNamespace()
Returns the XML namespace associated with theEPPCodecComponent
.java.lang.String
getOrg()
Gets the contact organizationjava.lang.String
getRootName()
Get root tag name for contact postal definition.java.lang.String
getType()
Get contact address type.boolean
hasAddress()
Returnstrue
if the postal info defintion has address.boolean
hasName()
Returnstrue
if the postal info definition has name.boolean
hasOrg()
Returnstrue
if the postal info definition has organization.boolean
hasRootName()
Returnstrue
if the postal info definition has root name.boolean
hasType()
Returnstrue
if the postal info definition has type.boolean
isValidated()
Show whether needs to call validateState()void
setAddress(EPPContactAddress aAddress)
Sets the contact addressvoid
setName(java.lang.String aName)
Sets the contact name.void
setOrg(java.lang.String aOrg)
Sets the contact organizationvoid
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 ofObject.toString
, which will result in an indented XMLString
representation of the concreteEPPCodecComponent
.
-
-
-
Field Detail
-
ELM_NAME_POSTAL_INFO
public static final java.lang.String ELM_NAME_POSTAL_INFO
XML tag name for theorg
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 invokingencode
, 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
- id -
-
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 theATTR_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 intaAddress
- contact address
- org -
-
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 nameaType
- postal definition type loc or intaAddress
- contact address
- org -
-
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 nameaOrg
- contact organization if defined;null
otherwiseaType
- postal definition type loc or intaAddress
- 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()
Returnstrue
if the postal info definition has organization.- Returns:
true
if the postal info definition has organizationfalse
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()
Returnstrue
if the postal info defintion has address.- Returns:
true
if the postal info definition has addressfalse
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 theEPPContactPostalDefinition
instance.- Specified by:
encode
in interfaceEPPCodecComponent
- 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 theEPPContactPostalDefinition
attributes from the aElement DOM Element tree.- Specified by:
decode
in interfaceEPPCodecComponent
- Parameters:
aElement
- Root DOM Element to decodeEPPContactPostalDefinition
from.- Throws:
EPPDecodeException
- On decoding error
-
equals
public boolean equals(java.lang.Object aObject)
implements a deepEPPContactPostalDefinition
compare.- Overrides:
equals
in classjava.lang.Object
- Parameters:
aObject
-EPPContactPostalDefinition
instance to compare with- Returns:
true
if objects are equal otherwisefalse
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
CloneEPPContactPostalDefinition
.- Specified by:
clone
in interfaceEPPCodecComponent
- Overrides:
clone
in classjava.lang.Object
- Returns:
- clone of
EPPContactPostalDefinition
- Throws:
java.lang.CloneNotSupportedException
- standard Object.clone exception
-
toString
public java.lang.String toString()
Implementation ofObject.toString
, which will result in an indented XMLString
representation of the concreteEPPCodecComponent
.- Overrides:
toString
in classjava.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()
Returnstrue
if the postal info definition has name.- Returns:
true
if the postal info definition has namefalse
otherwise
-
getRootName
public java.lang.String getRootName()
Get root tag name for contact postal definition.- Returns:
- String root tag name
-
hasRootName
public boolean hasRootName()
Returnstrue
if the postal info definition has root name.- Returns:
true
if the postal info definition has root namefalse
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()
Returnstrue
if the postal info definition has type.- Returns:
true
if the postal info definition has typefalse
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 theEPPCodecComponent
.- Specified by:
getNamespace
in interfaceEPPCodecComponent
- Returns:
- XML namespace for the
EPPCodecComponent
.
-
-