com.verisign.epp.codec.registry

## Class EPPRegistryKey

- java.lang.Object
- - com.verisign.epp.codec.registry.EPPRegistryKey

- All Implemented Interfaces:
    EPPCodecComponent, java.io.Serializable, java.lang.Cloneable
  Direct Known Subclasses:
    EPPRegistryDS

      public class EPPRegistryKey
      extends java.lang.Object
      implements EPPCodecComponent

  Defines the Key Data Interface, as defined in RFC 5910, policies. The <registry:keyDataInterface> element contains the following child elements:
  - <registry:min> - the minimum number of keys associated with the domain object. Use `getMin()` and `setMin(Integer)` to get and set the element.
  - <registry:max> - the maximum number of keys associated with the domain object. Use `getMax()` and `setMax(Integer)` to get and set the element.
  - <registry:alg> - Zero or more <registry:alg> elements that define the supported algorithms as described in section 2.1.3 of RFC 4034. Use `getAlgorithms()` and `setAlgorithms(List)` to get and set the element. Use `addAlgorithm(String)` to add an algorithm `String` to an existing `List`.
  See Also:
    `EPPRegistryDNSSEC`, Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `ALGORITHM` XML Element Name of `algorithms` attribute.
    `static java.lang.String` | `ELM_MAX` XML Element Name of `max` attribute.
    `static java.lang.String` | `ELM_MIN` XML Element Name of `min` attribute.
    `static java.lang.String` | `ELM_NAME` XML Element Name of `EPPRegistryKey` root element.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EPPRegistryKey()` Default constructor.
    `EPPRegistryKey(java.lang.Integer min, java.lang.Integer max, java.util.List algorithms)` Constructs an instance with `min`, `max` and `List` of `algorithms`.
    `EPPRegistryKey(int min, int max, java.util.List algorithms)` Constructs an instance with `min`, `max` and `List` of `algorithms`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAlgorithm(java.lang.String altorithm)` Add one algorithm to existing supported algorithms.
    `java.lang.Object` | `clone()` Clone `EPPRegistryKey`.
    `void` | `decode(org.w3c.dom.Element aElement)` Decode the `EPPRegistryKey` 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 `EPPRegistryKey` instance.
    `boolean` | `equals(java.lang.Object aObject)` implements a deep `EPPRegistryKey` compare.
    `java.util.List` | `getAlgorithms()` Get the supported algorithms.
    `java.lang.Integer` | `getMax()` Get the maximum number of keys.
    `java.lang.Integer` | `getMin()` Get the minimum number of keys.
    `java.lang.String` | `getNamespace()` Returns the XML namespace associated with the `EPPCodecComponent`.
    `java.lang.String` | `getRootName()` Get the root element tag name.
    `void` | `setAlgorithms(java.util.List algorithms)` Set the supported algorithms.
    `void` | `setMax(java.lang.Integer max)` Set the maximum number of keys.
    `void` | `setMin(java.lang.Integer min)` Set the minimum number of keys.
    `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`

- - ### Field Detail

    - #### ELM_NAME

          public static final java.lang.String ELM_NAME

      XML Element Name of `EPPRegistryKey` root element.
      See Also:
        Constant Field Values

    - #### ELM_MIN

          public static final java.lang.String ELM_MIN

      XML Element Name of `min` attribute.
      See Also:
        Constant Field Values

    - #### ELM_MAX

          public static final java.lang.String ELM_MAX

      XML Element Name of `max` attribute.
      See Also:
        Constant Field Values

    - #### ALGORITHM

          public static final java.lang.String ALGORITHM

      XML Element Name of `algorithms` attribute.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### EPPRegistryKey

          public EPPRegistryKey()

      Default constructor. Must call `setMin(Integer)` and `setMax(Integer)` before calling `encode(Document)` method.

    - #### EPPRegistryKey

          public EPPRegistryKey(java.lang.Integer min,
                                java.lang.Integer max,
                                java.util.List algorithms)

      Constructs an instance with `min`, `max` and `List` of `algorithms`.
      Parameters:
        `min` - minimum number of keys associated with the domain object
        `max` - maximum number of keys associated with the domain object
        `algorithms` - supported algorithms as described in section 2.1.3 of RFC 4034

    - #### EPPRegistryKey

          public EPPRegistryKey(int min,
                                int max,
                                java.util.List algorithms)

      Constructs an instance with `min`, `max` and `List` of `algorithms`.
      Parameters:
        `min` - minimum number of keys associated with the domain object
        `max` - maximum number of keys associated with the domain object
        `algorithms` - supported algorithms as described in section 2.1.3 of RFC 4034

  - ### Method Detail

    - #### encode

          public org.w3c.dom.Element encode(org.w3c.dom.Document aDocument)
                                     throws EPPEncodeException

      Encode a DOM Element tree from the attributes of the `EPPRegistryKey` 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 `EPPRegistryKey` instance.
      Throws:
        `EPPEncodeException` - - Unable to encode `EPPRegistryKey` instance.

    - #### decode

          public void decode(org.w3c.dom.Element aElement)
                      throws EPPDecodeException

      Decode the `EPPRegistryKey` attributes from the aElement DOM Element tree.
      Specified by:
        `decode` in interface `EPPCodecComponent`
      Parameters:
        `aElement` - Root DOM Element to decode `EPPRegistryKey` from.
      Throws:
        `EPPDecodeException` - Unable to decode aElement

    - #### clone

          public java.lang.Object clone()
                                 throws java.lang.CloneNotSupportedException

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

    - #### equals

          public boolean equals(java.lang.Object aObject)

      implements a deep `EPPRegistryKey` compare.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `aObject` - `EPPRegistryKey` instance to compare with
      Returns:
        `true` if this object is the same as the aObject argument; `false` otherwise

    - #### 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.

    - #### getMin

          public java.lang.Integer getMin()

      Get the minimum number of keys.
      Returns:
        minimum number of keys associated with the domain object.

    - #### setMin

          public void setMin(java.lang.Integer min)

      Set the minimum number of keys.
      Parameters:
        `min` - minimum number of keys associated with the domain object.

    - #### getMax

          public java.lang.Integer getMax()

      Get the maximum number of keys.
      Returns:
        maximum number of keys associated with the domain object.

    - #### setMax

          public void setMax(java.lang.Integer max)

      Set the maximum number of keys.
      Parameters:
        `max` - maximum number of keys associated with the domain object.

    - #### getAlgorithms

          public java.util.List getAlgorithms()

      Get the supported algorithms.
      Returns:
        `List` of supported algorithms as dscsribed in section 2.1.3 of RFC 4034

    - #### setAlgorithms

          public void setAlgorithms(java.util.List algorithms)

      Set the supported algorithms.
      Parameters:
        `algorithms` - `List` of supported algorithms as dscsribed in section 2.1.3 of RFC 4034

    - #### addAlgorithm

          public void addAlgorithm(java.lang.String altorithm)

      Add one algorithm to existing supported algorithms.
      Parameters:
        `altorithm` - supported algorithms as dscsribed in section 2.1.3 of RFC 4034

    - #### getRootName

          public java.lang.String getRootName()

      Get the root element tag name.
      Returns:
        `ELM_NAME`

    - #### getNamespace

          public java.lang.String getNamespace()

      Returns the XML namespace associated with the `EPPCodecComponent`.
      Specified by:
        `getNamespace` in interface `EPPCodecComponent`
      Returns:
        XML namespace for the `EPPCodecComponent`.