Package com.verisign.epp.codec.fee.v1_0
Class EPPFeePeriod
java.lang.Object
com.verisign.epp.codec.fee.v1_0.EPPFeePeriod
- All Implemented Interfaces:
EPPCodecComponent,Serializable,Cloneable
Represents a fee period. Validity periods are measured in years or months
with the appropriate units specified using the
unit attribute.
Valid values for the unit attribute are y for years
and m for months.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEPPFeePerioddefault constructor.EPPFeePeriod(int aPeriod) EPPFeePeriodconstructor that takes the period value with a default unit ofPERIOD_UNIT_YEAR.EPPFeePeriod(String aPUnit, int aPeriod) EPPFeePeriodconstructor that takes the period and period unit as an arguments. -
Method Summary
Modifier and TypeMethodDescriptionclone()CloneEPPFeePeriodinstance.voidDecode the EPPFeePeriod attributes from the aElement DOM Element tree.Encode a DOM Element tree from the attributes of the EPPFeePeriod instance.booleanImplements a deepEPPFeePeriodcompare.Returns the XML namespace associated with theEPPCodecComponent.intGet the period.getPUnit()Get the period unit.booleanTest whether the period has been specified.voidsetPeriod(int aPeriod) Set the period.voidSets the period unit.toString()Implementation ofObject.toString, which will result in an indented XMLStringrepresentation of the concreteEPPCodecComponent.
-
Field Details
-
PERIOD_UNIT_MONTH
Period in Unit Month- See Also:
-
PERIOD_UNIT_YEAR
Period in Unit Year- See Also:
-
UNSPEC_PERIOD
public static final int UNSPEC_PERIODUnspecified Period- See Also:
-
MAX_PERIOD
public static final int MAX_PERIODMaximum number of periods.- See Also:
-
MIN_PERIOD
public static final int MIN_PERIODMinimum number of periods.- See Also:
-
ELM_LOCALNAME
XML local name forEPPFeePeriod.- See Also:
-
-
Constructor Details
-
EPPFeePeriod
public EPPFeePeriod()EPPFeePerioddefault constructor. The period is initialized toUNSPEC_PERIOD. The period must be set before invokingencode. -
EPPFeePeriod
public EPPFeePeriod(int aPeriod) EPPFeePeriodconstructor that takes the period value with a default unit ofPERIOD_UNIT_YEAR.- Parameters:
aPeriod- Period value
-
EPPFeePeriod
EPPFeePeriodconstructor that takes the period and period unit as an arguments.- Parameters:
aPUnit- Period valueaPeriod- The period unit that must be eitherPERIOD_UNIT_YEARorPERIOD_UNIT_MONTH.
-
-
Method Details
-
clone
CloneEPPFeePeriodinstance.- Specified by:
clonein interfaceEPPCodecComponent- Overrides:
clonein classObject- Returns:
- clone of
EPPFeePeriod - Throws:
CloneNotSupportedException- standard Object.clone exception
-
decode
Decode the EPPFeePeriod attributes from the aElement DOM Element tree.- Specified by:
decodein interfaceEPPCodecComponent- Parameters:
aElement- - Root DOM Element to decode EPPFeePeriod from.- Throws:
EPPDecodeException- Unable to decode aElement
-
encode
Encode a DOM Element tree from the attributes of the EPPFeePeriod instance.- Specified by:
encodein interfaceEPPCodecComponent- Parameters:
aDocument- - DOM Document that is being built. Used as an Element factory.- Returns:
- Element - Root DOM Element representing the EPPFeePeriod instance.
- Throws:
EPPEncodeException- - Unable to encode EPPFeePeriod instance.
-
equals
Implements a deepEPPFeePeriodcompare. -
getPeriod
public int getPeriod()Get the period.- Returns:
- The period if defined;
UNSPEC_PERIODotherwise.
-
getPUnit
Get the period unit.- Returns:
- Either
PERIOD_UNIT_YEARfor year orPERIOD_UNIT_MONTHfor month.
-
isPeriodUnspec
public boolean isPeriodUnspec()Test whether the period has been specified.- Returns:
trueif unspecified;falseotherwise.
-
setPeriod
Set the period.- Parameters:
aPeriod- Period value. Can beUNSPEC_PERIODto clear the period; otherwise the period must be betweenMIN_PERIODandMAX_PERIOD.- Throws:
EPPCodecException- Error with period value.
-
setPUnit
Sets the period unit.- Parameters:
aPUnit- Must be eitherPERIOD_UNIT_YEARorPERIOD_UNIT_MONTH. If not, no change will be made.
-
toString
Implementation ofObject.toString, which will result in an indented XMLStringrepresentation of the concreteEPPCodecComponent. -
getNamespace
Returns the XML namespace associated with theEPPCodecComponent.- Specified by:
getNamespacein interfaceEPPCodecComponent- Returns:
- XML namespace for the
EPPCodecComponent.
-