Package com.verisign.epp.codec.contact

## Class EPPContactUpdateCmd

- java.lang.Object
- - com.verisign.epp.codec.gen.EPPCommand
  - - com.verisign.epp.codec.gen.EPPUpdateCmd
    - - com.verisign.epp.codec.contact.EPPContactUpdateCmd

- All Implemented Interfaces:
    `EPPCodecComponent`, `EPPMessage`, `java.io.Serializable`, `java.lang.Cloneable`

      public class EPPContactUpdateCmd
      extends EPPUpdateCmd

  Represents an EPP Host <update> command. The EPP <update> command provides a transform operation that allows a client to modify the attributes of a contact object. In addition to the standard EPP command elements, the <update> command MUST contain a <contact:update> element that identifies the contact namespace and the location of the contact schema. The <contact:update> element SHALL contain the following child elements:
  - A <contact:id> element that contains the server-unique identifier of the contact object to be updated. Use `getId` and `setId` to get and set the element.
  - An OPTIONAL <contact:add> element that contains attribute values to be added to the host object. Use `getAdd` and `setAdd` to get and set the element.
  - An OPTIONAL <contact:rem> element that contains attribute values to be removed from the host object. Use `getRemove` and `setRemove` to get and set the element.
  - An OPTIONAL <contact:chg> element that contains attribute values to be changed to the host object. Use `getChange` and `setChange` to get and set the element.
  `EPPReponse` is the response associated with `EPPContactUpdateCmd`.
  See Also:
    `EPPResponse`, `EPPContactAddChange`, Serialized Form

- - ### Field Summary

    - ### Fields inherited from class com.verisign.epp.codec.gen.EPPCommand

      `extensions, OP_APPROVE, OP_CANCEL, OP_QUERY, OP_REJECT, OP_REQUEST, transId, TYPE_CHECK, TYPE_CREATE, TYPE_DELETE, TYPE_INFO, TYPE_LOGIN, TYPE_LOGOUT, TYPE_POLL, TYPE_RENEW, TYPE_TRANSFER, TYPE_UPDATE`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `EPPContactUpdateCmd()` | `EPPContactUpdateCmd` default constructor.
    `EPPContactUpdateCmd​(java.lang.String aTransId, java.lang.String aId)` | `EPPContactUpdateCmd` constructor.
    `EPPContactUpdateCmd​(java.lang.String aTransId, java.lang.String aId, EPPContactAddChange aAdd, EPPContactAddChange aRemove, EPPContactAddChange aChange)` | `EPPContactUpdateCmd` constructor that takes the required attributes as arguments.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.Object` | `clone()` | Clone `EPPContactUpdateCmd`.
    `protected void` | `doDecode​(org.w3c.dom.Element aElement)` | Decode the `EPPContactUpdateCmd` attributes from the aElement DOM Element tree.
    `protected org.w3c.dom.Element` | `doEncode​(org.w3c.dom.Document aDocument)` | Encode a DOM Element tree from the attributes of the `EPPContactUpdateCmd` instance.
    `boolean` | `equals​(java.lang.Object aObject)` | Compare an instance of `EPPContactUpdateCmd` with this instance.
    `EPPContactAddChange` | `getAdd()` | Gets the items to add to the contact.
    `EPPContactAddChange` | `getChange()` | Gets the items to change to the contact.
    `java.lang.String` | `getId()` | Gets the contact id.
    `java.lang.String` | `getKey()` | Gets the key for the contact object, which is the contact identifier.
    `java.lang.String` | `getNamespace()` | Gets the EPP command Namespace associated with `EPPContactUpdateCmd`.
    `EPPContactAddChange` | `getRemove()` | Gets the items to remove from the contact.
    `boolean` | `hasAdd()` | Returns `true` if add exists.
    `boolean` | `hasChange()` | Returns `true` if change exists.
    `boolean` | `hasId()` | Returns `true` if id exists.
    `boolean` | `hasRemove()` | Returns `true` if remove exists.
    `void` | `setAdd​(EPPContactAddChange aAdd)` | Sets the items to add to the contact.
    `void` | `setChange​(EPPContactAddChange aChange)` | Sets the items to change in the contact.
    `void` | `setId​(java.lang.String aId)` | Sets the contact id.
    `void` | `setRemove​(EPPContactAddChange aRemove)` | Sets the items to remove from the contact.
    `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 com.verisign.epp.codec.gen.EPPUpdateCmd

      `doGenDecode, doGenEncode, getType`

    - ### Methods inherited from class com.verisign.epp.codec.gen.EPPCommand

      `addExtension, decode, encode, findDuplicateExtNamespaces, findExtNamespaces, findExtNamespaceSuffixes, findUnsupportedExtNamespaces, findUnsupportedExtNamespaceSuffixes, getExtension, getExtension, getExtensions, getOp, getTransId, hasExtension, hasExtensions, hasKey, hasTransId, setExtension, setExtensions, setTransId`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### EPPContactUpdateCmd

          public EPPContactUpdateCmd()

      `EPPContactUpdateCmd` default constructor. The name is initialized to `null`. The name must be set before invoking `encode`.

    - #### EPPContactUpdateCmd

          public EPPContactUpdateCmd​(java.lang.String aTransId,
                                     java.lang.String aId)

      `EPPContactUpdateCmd` constructor.
      Parameters:
        `aTransId` - Transaction Id associated with the command.
        `aId` - Contact ID

    - #### EPPContactUpdateCmd

          public EPPContactUpdateCmd​(java.lang.String aTransId,
                                     java.lang.String aId,
                                     EPPContactAddChange aAdd,
                                     EPPContactAddChange aRemove,
                                     EPPContactAddChange aChange)

      `EPPContactUpdateCmd` constructor that takes the required attributes as arguments.
      Parameters:
        `aTransId` - Transaction Id associated with the command.
        `aId` - Contact ID.
        `aAdd` - Attributes to add to the contact. `null` if no additions.
        `aRemove` - Attributes to remove from the contact. `null` if no removals.
        `aChange` - Attributes to remove from the contact. `null` if no changes.

  - ### Method Detail

    - #### getNamespace

          public java.lang.String getNamespace()

      Gets the EPP command Namespace associated with `EPPContactUpdateCmd`.
      Specified by:
        `getNamespace` in interface `EPPCodecComponent`
      Specified by:
        `getNamespace` in interface `EPPMessage`
      Specified by:
        `getNamespace` in class `EPPCommand`
      Returns:
        `EPPHostMapFactory.NS`

    - #### getKey

          public java.lang.String getKey()

      Gets the key for the contact object, which is the contact identifier.
      Overrides:
        `getKey` in class `EPPCommand`
      Returns:
        The host identifier if set; `null` otherwise.

    - #### doEncode

          protected org.w3c.dom.Element doEncode​(org.w3c.dom.Document aDocument)
                                          throws EPPEncodeException

      Encode a DOM Element tree from the attributes of the `EPPContactUpdateCmd` instance.
      Specified by:
        `doEncode` in class `EPPUpdateCmd`
      Parameters:
        `aDocument` - DOM Document that is being built. Used as an Element factory.
      Returns:
        Root DOM Element representing the `EPPContactUpdateCmd` instance.
      Throws:
        `EPPEncodeException` - Unable to encode `EPPContactUpdateCmd` instance.

    - #### doDecode

          protected void doDecode​(org.w3c.dom.Element aElement)
                           throws EPPDecodeException

      Decode the `EPPContactUpdateCmd` attributes from the aElement DOM Element tree.
      Specified by:
        `doDecode` in class `EPPUpdateCmd`
      Parameters:
        `aElement` - Root DOM Element to decode `EPPContactUpdateCmd` from.
      Throws:
        `EPPDecodeException` - Unable to decode aElement

    - #### equals

          public boolean equals​(java.lang.Object aObject)

      Compare an instance of `EPPContactUpdateCmd` with this instance.
      Overrides:
        `equals` in class `EPPUpdateCmd`
      Parameters:
        `aObject` - Object to compare with.
      Returns:
        `true` if equal; `false` otherwise

    - #### clone

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

      Clone `EPPContactUpdateCmd`.
      Specified by:
        `clone` in interface `EPPCodecComponent`
      Overrides:
        `clone` in class `EPPCommand`
      Returns:
        clone of `EPPContactUpdateCmd`
      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 `EPPCommand`
      Returns:
        Indented XML `String` if successful; `ERROR` otherwise.

    - #### hasId

          public boolean hasId()

      Returns `true` if id exists.
      Returns:
        `true` if id exists; otherwise `false`.

    - #### getId

          public java.lang.String getId()

      Gets the contact id.
      Returns:
        Contact id if set; `null` otherwise.

    - #### setId

          public void setId​(java.lang.String aId)

      Sets the contact id.
      Parameters:
        `aId` - Contact id

    - #### hasAdd

          public boolean hasAdd()

      Returns `true` if add exists.
      Returns:
        `true` if add exists; otherwise `false`.

    - #### getAdd

          public EPPContactAddChange getAdd()

      Gets the items to add to the contact.
      Returns:
        Object that contains the list of elements to add to the contact if defined; `null` otherwise.

    - #### setAdd

          public void setAdd​(EPPContactAddChange aAdd)

      Sets the items to add to the contact.
      Parameters:
        `aAdd` - Items to add to the contact.

    - #### hasChange

          public boolean hasChange()

      Returns `true` if change exists.
      Returns:
        `true` if change exists; otherwise `false`.

    - #### getChange

          public EPPContactAddChange getChange()

      Gets the items to change to the contact.
      Returns:
        Object that contains the list of elements to change to the contact if defined; `null` otherwise.

    - #### setChange

          public void setChange​(EPPContactAddChange aChange)

      Sets the items to change in the contact.
      Parameters:
        `aChange` - Items to change in the contact.

    - #### hasRemove

          public boolean hasRemove()

      Returns `true` if remove exists.
      Returns:
        `true` if remove exists; otherwise `false`.

    - #### getRemove

          public EPPContactAddChange getRemove()

      Gets the items to remove from the contact.
      Returns:
        Items to remove from the contact if defined; `null` otherwise.

    - #### setRemove

          public void setRemove​(EPPContactAddChange aRemove)

      Sets the items to remove from the contact.
      Parameters:
        `aRemove` - Items to remove from the contact.