com.verisign.epp.codec.fee.v1_0

## Class EPPFeeTransformResult

- java.lang.Object
- - com.verisign.epp.codec.fee.v1_0.EPPFeeTransformResult

- All Implemented Interfaces:
    EPPCodecComponent, java.io.Serializable, java.lang.Cloneable
  Direct Known Subclasses:
    EPPFeeCreData, EPPFeeDelData, EPPFeeRenData, EPPFeeTrnData, EPPFeeUpdData

      public abstract class EPPFeeTransformResult
      extends java.lang.Object
      implements EPPCodecComponent

  Abstract base class for the transform results (create, renew, update, delete, transfer) for enabling the server to return the currency, fees, credits, balance, and credit limit where appropriate.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EPPFeeTransformResult()` Default constructor for `EPPFeeTransformResult`.
    `EPPFeeTransformResult(java.lang.String aCurrency, java.math.BigDecimal aBalance, java.math.BigDecimal aCreditLimit, java.util.List<EPPFeeCredit> aCredits)` Constructor for `EPPFeeTransformResult` that takes all attributes that includes credits.
    `EPPFeeTransformResult(java.lang.String aCurrency, EPPFeeCredit aCredit)` Constructor for `EPPFeeTransformResult` that takes the required currency parameter along with a single credit.
    `EPPFeeTransformResult(java.lang.String aCurrency, EPPFeeValue aFee)` Constructor for `EPPFeeTransformResult` that takes the required currency parameter along with a single fee.
    `EPPFeeTransformResult(java.lang.String aCurrency, java.util.List<EPPFeeValue> aFees)` Constructor for `EPPFeeTransformResult` that takes the required currency parameter along with a list of fees.
    `EPPFeeTransformResult(java.lang.String aCurrency, java.util.List<EPPFeeValue> aFees, java.math.BigDecimal aBalance, java.math.BigDecimal aCreditLimit)` Constructor for `EPPFeeTransformResult` that takes all attributes that includes fees.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCredit(EPPFeeCredit aCredit)` Adds a credit to the list of credits.
    `void` | `addFee(EPPFeeValue aFee)` Adds a fee to the list of fees.
    `java.lang.Object` | `clone()` Clone an `EPPFeeTransformResult` instance.
    `void` | `decode(org.w3c.dom.Element aElement)` Decode a DOM element tree to initialize the instance attributes.
    `org.w3c.dom.Element` | `encode(org.w3c.dom.Document aDocument)` Encode instance into a DOM element tree.
    `boolean` | `equals(java.lang.Object aObject)` Compare an instance of `EPPFeeTransformResult` with this instance.
    `java.math.BigDecimal` | `getBalance()` Gets the available balance of the client.
    `java.math.BigDecimal` | `getCreditLimit()` Gets the maximum credit available to the client.
    `java.util.List<EPPFeeCredit>` | `getCredits()` Gets the list of credits if defined.
    `java.lang.String` | `getCurrency()` Gets the currency value.
    `java.util.List<EPPFeeValue>` | `getFees()` Gets the list of fees if defined.
    `protected abstract java.lang.String` | `getLocalName()` Abstract method that the sub-class must define to return the local name for the root element.
    `EPPFeePeriod` | `getPeriod()` Gets the period value.
    `boolean` | `hasBalance()` Is the balance defined?
    `boolean` | `hasCreditLimit()` Is the credit limit defined?
    `boolean` | `hasCredits()` Are the credits defined? The credits are used on a delete response.
    `boolean` | `hasCurrency()` Is the currency defined?
    `boolean` | `hasFees()` Are the fees defined?
    `boolean` | `hasPeriod()` Is the period defined?
    `void` | `setBalance(java.math.BigDecimal aBalance)` Sets the available balance of the client.
    `void` | `setCreditLimit(java.math.BigDecimal aCreditLimit)` Sets the maximum credit available to the client.
    `void` | `setCredits(java.util.List<EPPFeeCredit> aCredits)` Sets the list of credits.
    `void` | `setCurrency(java.lang.String aCurrency)` Sets the currency value.
    `void` | `setFees(java.util.List<EPPFeeValue> aFees)` Sets the list of fees.
    `void` | `setPeriod(EPPFeePeriod aPeriod)` Sets the period value.
    `java.lang.String` | `toString()` Implementation of `Object.toString`, which will result in an indented XML `String` representation of the concrete `EPPCodecComponent`.
    `protected abstract void` | `validateAttributes()` Validate the set of attributes on `encode`.

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

- - ### Constructor Detail

    - #### EPPFeeTransformResult

          public EPPFeeTransformResult()

      Default constructor for `EPPFeeTransformResult`.

    - #### EPPFeeTransformResult

          public EPPFeeTransformResult(java.lang.String aCurrency,
                                       EPPFeeValue aFee)

      Constructor for `EPPFeeTransformResult` that takes the required currency parameter along with a single fee.
      Parameters:
        `aCurrency` - Currency of the fee
        `aFee` - A single fee value

    - #### EPPFeeTransformResult

          public EPPFeeTransformResult(java.lang.String aCurrency,
                                       java.util.List<EPPFeeValue> aFees)

      Constructor for `EPPFeeTransformResult` that takes the required currency parameter along with a list of fees.
      Parameters:
        `aCurrency` - Currency of the fee
        `aFees` - The fees of the transform command

    - #### EPPFeeTransformResult

          public EPPFeeTransformResult(java.lang.String aCurrency,
                                       EPPFeeCredit aCredit)

      Constructor for `EPPFeeTransformResult` that takes the required currency parameter along with a single credit.
      Parameters:
        `aCurrency` - Currency of the fee
        `aCredit` - A single credit value

    - #### EPPFeeTransformResult

          public EPPFeeTransformResult(java.lang.String aCurrency,
                                       java.util.List<EPPFeeValue> aFees,
                                       java.math.BigDecimal aBalance,
                                       java.math.BigDecimal aCreditLimit)

      Constructor for `EPPFeeTransformResult` that takes all attributes that includes fees.
      Parameters:
        `aCurrency` - The currency of the fees
        `aFees` - The fees of the transform command
        `aBalance` - The remaining client balance
        `aCreditLimit` - The maximum credit available to the client

    - #### EPPFeeTransformResult

          public EPPFeeTransformResult(java.lang.String aCurrency,
                                       java.math.BigDecimal aBalance,
                                       java.math.BigDecimal aCreditLimit,
                                       java.util.List<EPPFeeCredit> aCredits)

      Constructor for `EPPFeeTransformResult` that takes all attributes that includes credits.
      Parameters:
        `aCurrency` - The currency of the fees
        `aBalance` - The remaining client balance
        `aCreditLimit` - The maximum credit available to the client
        `aCredits` - The credits of the command

  - ### Method Detail

    - #### getLocalName

          protected abstract java.lang.String getLocalName()

      Abstract method that the sub-class must define to return the local name for the root element.
      Returns:
        Local name of the root element of the result.

    - #### validateAttributes

          protected abstract void validateAttributes()
                                              throws EPPEncodeException

      Validate the set of attributes on `encode`. Each subclass must provide their own implementation of `validateAttributes` to validate that the required attributes are set and invalid attribute are not set prior to the `encode`.
      Throws:
        `EPPEncodeException` - When an attribute is incorrect set or not set.

    - #### hasCurrency

          public boolean hasCurrency()

      Is the currency defined?
      Returns:
        `true` if the currency is defined; `false` otherwise.

    - #### getCurrency

          public java.lang.String getCurrency()

      Gets the currency value.
      Returns:
        Currency if defined; `null` otherwise.

    - #### setCurrency

          public void setCurrency(java.lang.String aCurrency)

      Sets the currency value.
      Parameters:
        `aCurrency` - Currency value

    - #### hasPeriod

          public boolean hasPeriod()

      Is the period defined?
      Returns:
        `true` if the period is defined; `false` otherwise.

    - #### getPeriod

          public EPPFeePeriod getPeriod()

      Gets the period value.
      Returns:
        Period if defined; `null` otherwise.

    - #### setPeriod

          public void setPeriod(EPPFeePeriod aPeriod)

      Sets the period value.
      Parameters:
        `aPeriod` - Period value

    - #### hasFees

          public boolean hasFees()

      Are the fees defined?
      Returns:
        `true` if the fees are defined; `false` otherwise.

    - #### getFees

          public java.util.List<EPPFeeValue> getFees()

      Gets the list of fees if defined.
      Returns:
        List of fees if defined; empty list otherwise.

    - #### addFee

          public void addFee(EPPFeeValue aFee)

      Adds a fee to the list of fees.
      Parameters:
        `aFee` - The fee to add.

    - #### setFees

          public void setFees(java.util.List<EPPFeeValue> aFees)

      Sets the list of fees.
      Parameters:
        `aFees` - The fees to set.

    - #### hasCredits

          public boolean hasCredits()

      Are the credits defined? The credits are used on a delete response.
      Returns:
        `true` if the credits are defined; `false` otherwise.

    - #### getCredits

          public java.util.List<EPPFeeCredit> getCredits()

      Gets the list of credits if defined. The credits are used on a delete response.
      Returns:
        List of credits if defined; empty list otherwise.

    - #### addCredit

          public void addCredit(EPPFeeCredit aCredit)

      Adds a credit to the list of credits. The credits are used on a delete response.
      Parameters:
        `aCredit` - The credit to add.

    - #### setCredits

          public void setCredits(java.util.List<EPPFeeCredit> aCredits)

      Sets the list of credits. The credits are used on a delete response.
      Parameters:
        `aCredits` - The credits to set. Set to `null` for no credits.

    - #### hasBalance

          public boolean hasBalance()

      Is the balance defined?
      Returns:
        `true` if the balance is defined; `false` otherwise.

    - #### getBalance

          public java.math.BigDecimal getBalance()

      Gets the available balance of the client. The balance can be negative to indicate that the server has provided the client with credit.
      Returns:
        the balance if defined; `null` otherwise.

    - #### setBalance

          public void setBalance(java.math.BigDecimal aBalance)

      Sets the available balance of the client. The balance can be negative to indicate that the server has provided the client with credit.
      Parameters:
        `aBalance` - The available balance.

    - #### hasCreditLimit

          public boolean hasCreditLimit()

      Is the credit limit defined?
      Returns:
        `true` if the credit limit is defined; `false` otherwise.

    - #### getCreditLimit

          public java.math.BigDecimal getCreditLimit()

      Gets the maximum credit available to the client. This reflects how negative the `balance` attribute can go to.
      Returns:
        The maximum credit available to the client if defiend; `null` otherwise.

    - #### setCreditLimit

          public void setCreditLimit(java.math.BigDecimal aCreditLimit)

      Sets the maximum credit available to the client. This reflects how negative the `balance` attribute can go to.
      Parameters:
        `aCreditLimit` - The maximum credit available to the client.

    - #### encode

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

      Encode instance into a DOM element tree. A DOM Document is passed as an argument and functions as a factory for DOM objects. The root element associated with the instance is created and each instance attribute is appended as a child node.
      Specified by:
        `encode` in interface `EPPCodecComponent`
      Parameters:
        `aDocument` - DOM Document, which acts is an Element factory
      Returns:
        Element Root element associated with the object
      Throws:
        `EPPEncodeException` - Error encoding `EPPFeeTransformResult`

    - #### decode

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

      Decode a DOM element tree to initialize the instance attributes. The `aElement` argument represents the root DOM element and is used to traverse the DOM nodes for instance attribute values.
      Specified by:
        `decode` in interface `EPPCodecComponent`
      Parameters:
        `aElement` - `Element` to decode
      Throws:
        `EPPDecodeException` - Error decoding `Element`

    - #### clone

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

      Clone an `EPPFeeTransformResult` instance.
      Specified by:
        `clone` in interface `EPPCodecComponent`
      Overrides:
        `clone` in class `java.lang.Object`
      Returns:
        clone of concrete `EPPFeeTransformResult`
      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.

    - #### equals

          public boolean equals(java.lang.Object aObject)

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