com.verisign.epp.codec.registry.v02

## 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 and Description
    --- | ---
    `static class` | `EPPRegistryPeriodType.Unit` Possible values for the `unit` attribute.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `ATTR_UNIT` Attribute name for the `unit` attribute.
    `static java.lang.String` | `ELM_LOCALNAME` Default root element local name
    `protected java.lang.Integer` | `number` Number of the period
    `protected EPPRegistryPeriodType.Unit` | `unit` Unit of the period

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EPPRegistryPeriodType()` Default constructor for `EPPRegistryPeriodType`.
    `EPPRegistryPeriodType(java.lang.Integer aNumber, EPPRegistryPeriodType.Unit aUnit)` `EPPRegistryPeriodType` constructor that takes both the period number as an `Integer` and unit.
    `EPPRegistryPeriodType(int aNumber, EPPRegistryPeriodType.Unit aUnit)` `EPPRegistryPeriodType` constructor that takes both the period number as an `int` and unit.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `clone()` Clone `EPPRegistryPeriodType`.
    `void` | `decode(org.w3c.dom.Element aElement)` Decode the `EPPRegistryPeriodType` 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 the `EPPRegistryPeriodType` instance.
    `boolean` | `equals(java.lang.Object aObject)` implements a deep `EPPRegistryPeriodType` 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 of `Object.toString`, which will result in an indented XML `String` representation of the concrete `EPPCodecComponent`.

    - ### 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 the `unit` 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 for `EPPRegistryPeriodType`. The `number` and `unit` attributes must be set.

    - #### EPPRegistryPeriodType

          public EPPRegistryPeriodType(java.lang.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 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 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(org.w3c.dom.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(java.lang.Object aObject)

      implements a deep `EPPRegistryPeriodType` compare.
      Overrides:
        `equals` in class `java.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

      Clone `EPPRegistryPeriodType`.
      Specified by:
        `clone` in interface `EPPCodecComponent`
      Overrides:
        `clone` in class `java.lang.Object`
      Returns:
        clone of `EPPRegistryPeriodType`
      Throws:
        `java.lang.CloneNotSupportedException` - standard Object.clone exception

    - #### toString

          public java.lang.String toString()

      Implementation of `Object.toString`, which will result in an indented XML `String` representation of the concrete `EPPCodecComponent`.
      Overrides:
        `toString` in class `java.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