Class EPPBalanceByCurrency

java.lang.Object
com.verisign.epp.codec.balance.v03.EPPBalanceByCurrency
All Implemented Interfaces:
EPPCodecComponent, Serializable, Cloneable

public class EPPBalanceByCurrency extends Object implements EPPCodecComponent
The EPPBalanceByCurrency is the EPPCodecComponent that defines the breakdown of the Cash Balance (Section 2.6) by currency for multi-currency accounts. The class contains the cash balance values for a specific currency.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    XML local name for EPPBalanceByCurrency.
    static final String
    XML Element Name of EPPBalanceByCurrency root element.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new instance of EPPBalanceByCurrency
    EPPBalanceByCurrency(BigDecimal aCashBalance, String aCurrency, BigDecimal aAmount, BigDecimal aRate)
    Create a new instance of EPPBalanceByCurrency with all required attributes.
  • Method Summary

    Modifier and Type
    Method
    Description
    Clone EPPBalanceByCurrency.
    void
    decode(Element aElement)
    Populate the data of this instance with the data stored in the given Element of the DOM tree
    encode(Document aDocument)
    Append all data from this secDNS:keyData to the given DOM Document
    boolean
    equals(Object aObject)
    implements a deep EPPBalanceByCurrency compare.
    Sets the cash amount in the source currency represented by the currency attribute.
    Gets the cash balance in the target currency
    Gets the source currency of the amount attribute that is converted to the cashBalance attribute.
    Returns the XML namespace associated with the EPPCodecComponent.
    Gets the conversion rate for converting the source amount to the target cashBalance.
    void
    Sets the cash amount in the source currency represented by the currency attribute.
    void
    setCashBalance(BigDecimal aCashBalance)
    Sets the cash balance in the target currency
    void
    setCurrency(String aCurrency)
    Sets the source currency of the amount attribute that is converted to the cashBalance attribute.
    void
    Sets the conversion rate for converting the source amount to the target cashBalance.

    Methods inherited from class java.lang.Object

    finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • EPPBalanceByCurrency

      public EPPBalanceByCurrency()
      Create a new instance of EPPBalanceByCurrency
    • EPPBalanceByCurrency

      public EPPBalanceByCurrency(BigDecimal aCashBalance, String aCurrency, BigDecimal aAmount, BigDecimal aRate)
      Create a new instance of EPPBalanceByCurrency with all required attributes.
      Parameters:
      aCashBalance - The amount attribute translated to the target currency
      aCurrency - Currency of the amount attribute
      aAmount - The original value of the balance component prior to translation
      aRate - the precise conversion factor applied to translate that amount into the reference currency
  • Method Details

    • encode

      public Element encode(Document aDocument) throws EPPEncodeException
      Append all data from this secDNS:keyData to the given DOM Document
      Specified by:
      encode in interface EPPCodecComponent
      Parameters:
      aDocument - The DOM Document to append data to
      Returns:
      Encoded DOM Element
      Throws:
      EPPEncodeException - Thrown when errors occur during the encode attempt or if the instance is invalid.
    • decode

      public void decode(Element aElement) throws EPPDecodeException
      Populate the data of this instance with the data stored in the given Element of the DOM tree
      Specified by:
      decode in interface EPPCodecComponent
      Parameters:
      aElement - The root element of the fragment of XML
      Throws:
      EPPDecodeException - Thrown if any errors occur during decoding.
    • equals

      public boolean equals(Object aObject)
      implements a deep EPPBalanceByCurrency compare.
      Overrides:
      equals in class Object
      Parameters:
      aObject - EPPBalanceByCurrency instance to compare with
      Returns:
      true if equal false otherwise
    • getCashBalance

      public BigDecimal getCashBalance()
      Gets the cash balance in the target currency
      Returns:
      The cash balance in the target currency if set; null otherwise.
    • setCashBalance

      public void setCashBalance(BigDecimal aCashBalance)
      Sets the cash balance in the target currency
      Parameters:
      aCashBalance - the cash balance to set
    • getCurrency

      public String getCurrency()
      Gets the source currency of the amount attribute that is converted to the cashBalance attribute.
      Returns:
      the source currency of the amount attribute
    • setCurrency

      public void setCurrency(String aCurrency)
      Sets the source currency of the amount attribute that is converted to the cashBalance attribute.
      Parameters:
      aCurrency - The currency to set of the amount attribute
    • getAmount

      public BigDecimal getAmount()
      Sets the cash amount in the source currency represented by the currency attribute.
      Returns:
      The cash amount if defined; null otherwise.
    • setAmount

      public void setAmount(BigDecimal aAmount)
      Sets the cash amount in the source currency represented by the currency attribute.
      Parameters:
      aAmount - The cash amount in the source currency represented by the currency attribute.
    • getRate

      public BigDecimal getRate()
      Gets the conversion rate for converting the source amount to the target cashBalance.
      Returns:
      Conversion rate for converting the source amount to the target cashBalance if defined; null otherwise.
    • setRate

      public void setRate(BigDecimal aRate)
      Sets the conversion rate for converting the source amount to the target cashBalance.
      Parameters:
      aRate - The conversion rate to set
    • clone

      public Object clone() throws CloneNotSupportedException
      Clone EPPBalanceByCurrency.
      Specified by:
      clone in interface EPPCodecComponent
      Overrides:
      clone in class Object
      Returns:
      clone of EPPBalanceByCurrency
      Throws:
      CloneNotSupportedException - standard Object.clone exception
    • getNamespace

      public String getNamespace()
      Returns the XML namespace associated with the EPPCodecComponent.
      Specified by:
      getNamespace in interface EPPCodecComponent
      Returns:
      XML namespace for the EPPCodecComponent.