Class EPPRegistryPeriodType
- java.lang.Object
-
- com.verisign.epp.codec.registry.v02.EPPRegistryPeriodType
-
- All Implemented Interfaces:
EPPCodecComponent
,java.io.Serializable
,java.lang.Cloneable
- Direct Known Subclasses:
EPPRegistryDefaultPeriodType
,EPPRegistryGracePeriod
,EPPRegistryMaxPeriodType
,EPPRegistryMinPeriodType
,EPPRegistryPendingDeletePeriodType
,EPPRegistryPendingRestorePeriodType
,EPPRegistryRedemptionPeriodType
,EPPRegistryTransferHoldPeriodType
public abstract class EPPRegistryPeriodType extends java.lang.Object implements EPPCodecComponent
Abstract class for defining a period with a number and unit. The root element is defined by the sub-class.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EPPRegistryPeriodType.Unit
Possible values for theunit
attribute.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ATTR_UNIT
Attribute name for theunit
attribute.static java.lang.String
ELM_LOCALNAME
Default root element local nameprotected java.lang.Integer
number
Number of the periodprotected EPPRegistryPeriodType.Unit
unit
Unit of the period
-
Constructor Summary
Constructors Constructor Description EPPRegistryPeriodType()
Default constructor forEPPRegistryPeriodType
.EPPRegistryPeriodType(int aNumber, EPPRegistryPeriodType.Unit aUnit)
EPPRegistryPeriodType
constructor that takes both the period number as anint
and unit.EPPRegistryPeriodType(java.lang.Integer aNumber, EPPRegistryPeriodType.Unit aUnit)
EPPRegistryPeriodType
constructor that takes both the period number as anInteger
and unit.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
CloneEPPRegistryPeriodType
.void
decode(org.w3c.dom.Element aElement)
Decode theEPPRegistryPeriodType
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 theEPPRegistryPeriodType
instance.boolean
equals(java.lang.Object aObject)
implements a deepEPPRegistryPeriodType
compare.java.lang.Integer
getNumber()
Gets the period number.protected java.lang.String
getRootName()
Gets the root element local name.EPPRegistryPeriodType.Unit
getUnit()
Gets the period unit.void
setNumber(java.lang.Integer aNumber)
Sets the period number.void
setUnit(EPPRegistryPeriodType.Unit aUnit)
Sets the period unit.java.lang.String
toString()
Implementation ofObject.toString
, which will result in an indented XMLString
representation of the concreteEPPCodecComponent
.-
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.verisign.epp.codec.gen.EPPCodecComponent
getNamespace
-
-
-
-
Field Detail
-
ELM_LOCALNAME
public static final java.lang.String ELM_LOCALNAME
Default root element local name- See Also:
- Constant Field Values
-
ATTR_UNIT
public static final java.lang.String ATTR_UNIT
Attribute name for theunit
attribute.- See Also:
- Constant Field Values
-
number
protected java.lang.Integer number
Number of the period
-
unit
protected EPPRegistryPeriodType.Unit unit
Unit of the period
-
-
Constructor Detail
-
EPPRegistryPeriodType
public EPPRegistryPeriodType()
Default constructor forEPPRegistryPeriodType
. Thenumber
andunit
attributes must be set.
-
EPPRegistryPeriodType
public EPPRegistryPeriodType(java.lang.Integer aNumber, EPPRegistryPeriodType.Unit aUnit)
EPPRegistryPeriodType
constructor that takes both the period number as anInteger
and unit.- Parameters:
aNumber
- Period numberaUnit
- Period unit
-
EPPRegistryPeriodType
public EPPRegistryPeriodType(int aNumber, EPPRegistryPeriodType.Unit aUnit)
EPPRegistryPeriodType
constructor that takes both the period number as anint
and unit.- Parameters:
aNumber
- Period numberaUnit
- Period unit
-
-
Method Detail
-
getRootName
protected java.lang.String getRootName()
Gets the root element local name.- Returns:
- Root element local name.
-
encode
public org.w3c.dom.Element encode(org.w3c.dom.Document aDocument) throws EPPEncodeException
Encode a DOM Element tree from the attributes of theEPPRegistryPeriodType
instance.- Specified by:
encode
in interfaceEPPCodecComponent
- Parameters:
aDocument
- DOM Document that is being built. Used as an Element factory.- Returns:
- Element Root DOM Element representing the
EPPRegistryPeriodType
instance. - Throws:
EPPEncodeException
- - Unable to encodeEPPRegistryPeriodType
instance.
-
decode
public void decode(org.w3c.dom.Element aElement) throws EPPDecodeException
Decode theEPPRegistryPeriodType
attributes from the aElement DOM Element tree.- Specified by:
decode
in interfaceEPPCodecComponent
- Parameters:
aElement
- Root DOM Element to decodeEPPRegistryPeriodType
from.- Throws:
EPPDecodeException
- Unable to decode aElement
-
equals
public boolean equals(java.lang.Object aObject)
implements a deepEPPRegistryPeriodType
compare.- Overrides:
equals
in classjava.lang.Object
- Parameters:
aObject
-EPPRegistryPeriodType
instance to compare with- Returns:
true
if this object is the same as the aObject argument;false
otherwise
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
CloneEPPRegistryPeriodType
.- Specified by:
clone
in interfaceEPPCodecComponent
- Overrides:
clone
in classjava.lang.Object
- Returns:
- clone of
EPPRegistryPeriodType
- 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.
-
getNumber
public java.lang.Integer getNumber()
Gets the period number.- Returns:
- Period number if defined;
null
otherwise.
-
setNumber
public void setNumber(java.lang.Integer aNumber)
Sets the period number.- Parameters:
aNumber
- Period number
-
getUnit
public EPPRegistryPeriodType.Unit getUnit()
Gets the period unit.- Returns:
- Period unit if defined;
null
otherwise.
-
setUnit
public void setUnit(EPPRegistryPeriodType.Unit aUnit)
Sets the period unit.- Parameters:
aUnit
- Period unit
-
-