Class EPPRegistryPeriodType

java.lang.Object
com.verisign.epp.codec.registry.v02.EPPRegistryPeriodType
All Implemented Interfaces:
EPPCodecComponent, Serializable, Cloneable
Direct Known Subclasses:
EPPRegistryDefaultPeriodType, EPPRegistryGracePeriod, EPPRegistryMaxPeriodType, EPPRegistryMinPeriodType, EPPRegistryPendingDeletePeriodType, EPPRegistryPendingRestorePeriodType, EPPRegistryRedemptionPeriodType, EPPRegistryTransferHoldPeriodType

public abstract class EPPRegistryPeriodType extends 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:
  • Field Details

  • Constructor Details

    • EPPRegistryPeriodType

      public EPPRegistryPeriodType()
      Default constructor for EPPRegistryPeriodType. The number and unit attributes must be set.
    • EPPRegistryPeriodType

      public EPPRegistryPeriodType(Integer aNumber, EPPRegistryPeriodType.Unit aUnit)
      EPPRegistryPeriodType constructor that takes both the period number as an Integer and unit.
      Parameters:
      aNumber - Period number
      aUnit - Period unit
    • EPPRegistryPeriodType

      public EPPRegistryPeriodType(int aNumber, EPPRegistryPeriodType.Unit aUnit)
      EPPRegistryPeriodType constructor that takes both the period number as an int and unit.
      Parameters:
      aNumber - Period number
      aUnit - Period unit
  • Method Details

    • getRootName

      protected String getRootName()
      Gets the root element local name.
      Returns:
      Root element local name.
    • encode

      public Element encode(Document aDocument) throws EPPEncodeException
      Encode a DOM Element tree from the attributes of the EPPRegistryPeriodType instance.
      Specified by:
      encode in interface EPPCodecComponent
      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 encode EPPRegistryPeriodType instance.
    • decode

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

      public boolean equals(Object aObject)
      implements a deep EPPRegistryPeriodType compare.
      Overrides:
      equals in class Object
      Parameters:
      aObject - EPPRegistryPeriodType instance to compare with
      Returns:
      true if this object is the same as the aObject argument; false otherwise
    • clone

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

      public Integer getNumber()
      Gets the period number.
      Returns:
      Period number if defined; null otherwise.
    • setNumber

      public void setNumber(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