Class EPPBalanceByCurrency
java.lang.Object
com.verisign.epp.codec.balance.v04.EPPBalanceByCurrency
- All Implemented Interfaces:
EPPCodecComponent,Serializable,Cloneable
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 -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance of EPPBalanceByCurrencyEPPBalanceByCurrency(BigDecimal aCashBalance, String aCurrency, BigDecimal aAmount, BigDecimal aRate) Create a new instance ofEPPBalanceByCurrencywith all required attributes. -
Method Summary
Modifier and TypeMethodDescriptionclone()CloneEPPBalanceByCurrency.voidPopulate the data of this instance with the data stored in the given Element of the DOM treeEncode the Balance by Currency attributes to DOM.booleanimplements a deepEPPBalanceByCurrencycompare.Sets the cash amount in the source currency represented by thecurrencyattribute.Gets the cash balance in the target currencyGets the source currency of theamountattribute that is converted to thecashBalanceattribute.Returns the XML namespace associated with theEPPCodecComponent.getRate()Gets the conversion rate for converting the sourceamountto the targetcashBalance.voidsetAmount(BigDecimal aAmount) Sets the cash amount in the source currency represented by thecurrencyattribute.voidsetCashBalance(BigDecimal aCashBalance) Sets the cash balance in the target currencyvoidsetCurrency(String aCurrency) Sets the source currency of theamountattribute that is converted to thecashBalanceattribute.voidsetRate(BigDecimal aRate) Sets the conversion rate for converting the sourceamountto the targetcashBalance.
-
Field Details
-
ELM_LOCALNAME
XML local name forEPPBalanceByCurrency.- See Also:
-
ELM_NAME
XML Element Name ofEPPBalanceByCurrencyroot element.- See Also:
-
-
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 ofEPPBalanceByCurrencywith all required attributes.- Parameters:
aCashBalance- Theamountattribute translated to the target currencyaCurrency- Currency of theamountattributeaAmount- The original value of the balance component prior to translationaRate- the precise conversion factor applied to translate that amount into the reference currency
-
-
Method Details
-
encode
Encode the Balance by Currency attributes to DOM.- Specified by:
encodein interfaceEPPCodecComponent- 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
Populate the data of this instance with the data stored in the given Element of the DOM tree- Specified by:
decodein interfaceEPPCodecComponent- Parameters:
aElement- The root element of the fragment of XML- Throws:
EPPDecodeException- Thrown if any errors occur during decoding.
-
equals
implements a deepEPPBalanceByCurrencycompare. -
getCashBalance
Gets the cash balance in the target currency- Returns:
- The cash balance in the target currency if set;
nullotherwise.
-
setCashBalance
Sets the cash balance in the target currency- Parameters:
aCashBalance- the cash balance to set
-
getCurrency
Gets the source currency of theamountattribute that is converted to thecashBalanceattribute.- Returns:
- the source currency of the
amountattribute
-
setCurrency
Sets the source currency of theamountattribute that is converted to thecashBalanceattribute.- Parameters:
aCurrency- The currency to set of theamountattribute
-
getAmount
Sets the cash amount in the source currency represented by thecurrencyattribute.- Returns:
- The cash amount if defined;
nullotherwise.
-
setAmount
Sets the cash amount in the source currency represented by thecurrencyattribute.- Parameters:
aAmount- The cash amount in the source currency represented by thecurrencyattribute.
-
getRate
Gets the conversion rate for converting the sourceamountto the targetcashBalance.- Returns:
- Conversion rate for converting the source
amountto the targetcashBalanceif defined;nullotherwise.
-
setRate
Sets the conversion rate for converting the sourceamountto the targetcashBalance.- Parameters:
aRate- The conversion rate to set
-
clone
CloneEPPBalanceByCurrency.- Specified by:
clonein interfaceEPPCodecComponent- Overrides:
clonein classObject- Returns:
- clone of
EPPBalanceByCurrency - Throws:
CloneNotSupportedException- standard Object.clone exception
-
getNamespace
Returns the XML namespace associated with theEPPCodecComponent.- Specified by:
getNamespacein interfaceEPPCodecComponent- Returns:
- XML namespace for the
EPPCodecComponent.
-