Package 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 Description EPPFeeTransformResult()Default constructor forEPPFeeTransformResult.EPPFeeTransformResult(java.lang.String aCurrency, EPPFeeCredit aCredit)Constructor forEPPFeeTransformResultthat takes the required currency parameter along with a single credit.EPPFeeTransformResult(java.lang.String aCurrency, EPPFeeValue aFee)Constructor forEPPFeeTransformResultthat takes the required currency parameter along with a single fee.EPPFeeTransformResult(java.lang.String aCurrency, java.math.BigDecimal aBalance, java.math.BigDecimal aCreditLimit, java.util.List<EPPFeeCredit> aCredits)Constructor forEPPFeeTransformResultthat takes all attributes that includes credits.EPPFeeTransformResult(java.lang.String aCurrency, java.util.List<EPPFeeValue> aFees)Constructor forEPPFeeTransformResultthat 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 forEPPFeeTransformResultthat takes all attributes that includes fees.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddCredit(EPPFeeCredit aCredit)Adds a credit to the list of credits.voidaddFee(EPPFeeValue aFee)Adds a fee to the list of fees.java.lang.Objectclone()Clone anEPPFeeTransformResultinstance.voiddecode(org.w3c.dom.Element aElement)Decode a DOM element tree to initialize the instance attributes.org.w3c.dom.Elementencode(org.w3c.dom.Document aDocument)Encode instance into a DOM element tree.booleanequals(java.lang.Object aObject)Compare an instance ofEPPFeeTransformResultwith this instance.java.math.BigDecimalgetBalance()Gets the available balance of the client.java.math.BigDecimalgetCreditLimit()Gets the maximum credit available to the client.java.util.List<EPPFeeCredit>getCredits()Gets the list of credits if defined.java.lang.StringgetCurrency()Gets the currency value.java.util.List<EPPFeeValue>getFees()Gets the list of fees if defined.protected abstract java.lang.StringgetLocalName()Abstract method that the sub-class must define to return the local name for the root element.EPPFeePeriodgetPeriod()Gets the period value.booleanhasBalance()Is the balance defined?booleanhasCreditLimit()Is the credit limit defined?booleanhasCredits()Are the credits defined? The credits are used on a delete response.booleanhasCurrency()Is the currency defined?booleanhasFees()Are the fees defined?booleanhasPeriod()Is the period defined?voidsetBalance(java.math.BigDecimal aBalance)Sets the available balance of the client.voidsetCreditLimit(java.math.BigDecimal aCreditLimit)Sets the maximum credit available to the client.voidsetCredits(java.util.List<EPPFeeCredit> aCredits)Sets the list of credits.voidsetCurrency(java.lang.String aCurrency)Sets the currency value.voidsetFees(java.util.List<EPPFeeValue> aFees)Sets the list of fees.voidsetPeriod(EPPFeePeriod aPeriod)Sets the period value.java.lang.StringtoString()Implementation ofObject.toString, which will result in an indented XMLStringrepresentation of the concreteEPPCodecComponent.protected abstract voidvalidateAttributes()Validate the set of attributes onencode.-
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 forEPPFeeTransformResult.
-
EPPFeeTransformResult
public EPPFeeTransformResult(java.lang.String aCurrency, EPPFeeValue aFee)Constructor forEPPFeeTransformResultthat takes the required currency parameter along with a single fee.- Parameters:
aCurrency- Currency of the feeaFee- A single fee value
-
EPPFeeTransformResult
public EPPFeeTransformResult(java.lang.String aCurrency, java.util.List<EPPFeeValue> aFees)Constructor forEPPFeeTransformResultthat takes the required currency parameter along with a list of fees.- Parameters:
aCurrency- Currency of the feeaFees- The fees of the transform command
-
EPPFeeTransformResult
public EPPFeeTransformResult(java.lang.String aCurrency, EPPFeeCredit aCredit)Constructor forEPPFeeTransformResultthat takes the required currency parameter along with a single credit.- Parameters:
aCurrency- Currency of the feeaCredit- 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 forEPPFeeTransformResultthat takes all attributes that includes fees.- Parameters:
aCurrency- The currency of the feesaFees- The fees of the transform commandaBalance- The remaining client balanceaCreditLimit- 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 forEPPFeeTransformResultthat takes all attributes that includes credits.- Parameters:
aCurrency- The currency of the feesaBalance- The remaining client balanceaCreditLimit- The maximum credit available to the clientaCredits- 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 EPPEncodeExceptionValidate the set of attributes onencode. Each subclass must provide their own implementation ofvalidateAttributesto validate that the required attributes are set and invalid attribute are not set prior to theencode.- Throws:
EPPEncodeException- When an attribute is incorrect set or not set.
-
hasCurrency
public boolean hasCurrency()
Is the currency defined?- Returns:
trueif the currency is defined;falseotherwise.
-
getCurrency
public java.lang.String getCurrency()
Gets the currency value.- Returns:
- Currency if defined;
nullotherwise.
-
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:
trueif the period is defined;falseotherwise.
-
getPeriod
public EPPFeePeriod getPeriod()
Gets the period value.- Returns:
- Period if defined;
nullotherwise.
-
setPeriod
public void setPeriod(EPPFeePeriod aPeriod)
Sets the period value.- Parameters:
aPeriod- Period value
-
hasFees
public boolean hasFees()
Are the fees defined?- Returns:
trueif the fees are defined;falseotherwise.
-
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:
trueif the credits are defined;falseotherwise.
-
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 tonullfor no credits.
-
hasBalance
public boolean hasBalance()
Is the balance defined?- Returns:
trueif the balance is defined;falseotherwise.
-
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;
nullotherwise.
-
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:
trueif the credit limit is defined;falseotherwise.
-
getCreditLimit
public java.math.BigDecimal getCreditLimit()
Gets the maximum credit available to the client. This reflects how negative thebalanceattribute can go to.- Returns:
- The maximum credit available to the client if defiend;
nullotherwise.
-
setCreditLimit
public void setCreditLimit(java.math.BigDecimal aCreditLimit)
Sets the maximum credit available to the client. This reflects how negative thebalanceattribute 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 EPPEncodeExceptionEncode 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:
encodein interfaceEPPCodecComponent- Parameters:
aDocument- DOM Document, which acts is an Element factory- Returns:
- Element Root element associated with the object
- Throws:
EPPEncodeException- Error encodingEPPFeeTransformResult
-
decode
public void decode(org.w3c.dom.Element aElement) throws EPPDecodeExceptionDecode a DOM element tree to initialize the instance attributes. TheaElementargument represents the root DOM element and is used to traverse the DOM nodes for instance attribute values.- Specified by:
decodein interfaceEPPCodecComponent- Parameters:
aElement-Elementto decode- Throws:
EPPDecodeException- Error decodingElement
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionClone anEPPFeeTransformResultinstance.- Specified by:
clonein interfaceEPPCodecComponent- Overrides:
clonein classjava.lang.Object- Returns:
- clone of concrete
EPPFeeTransformResult - Throws:
java.lang.CloneNotSupportedException- standard Object.clone exception
-
toString
public java.lang.String toString()
Implementation ofObject.toString, which will result in an indented XMLStringrepresentation of the concreteEPPCodecComponent.- Overrides:
toStringin classjava.lang.Object- Returns:
- Indented XML
Stringif successful;ERRORotherwise.
-
equals
public boolean equals(java.lang.Object aObject)
Compare an instance ofEPPFeeTransformResultwith this instance.- Overrides:
equalsin classjava.lang.Object- Parameters:
aObject- Object to compare with.- Returns:
trueif equal;falseotherwise.
-
-