Package com.verisign.epp.codec.balance
Class EPPCreditThreshold
java.lang.Object
com.verisign.epp.codec.balance.EPPCreditThreshold
- All Implemented Interfaces:
EPPCodecComponent,Serializable,Cloneable
The
EPPCreditThreshold is the EPPCodecComponent
that knows how to encode and decode Credit Threshold Type elements from/to
XML and object instance.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance of EPPCreditThreshold.EPPCreditThreshold(String aType, BigDecimal aCreditThresholdValue) Create a new instance of EPPCreditThreshold with the given threshold type and threshold amount -
Method Summary
Modifier and TypeMethodDescriptionclone()CloneEPPCreditThreshold.voidPopulate the data of this instance with the data stored in the given Element of the DOM tree.Append all attributes frm theEPPCreditThresholdto the given DOM Documentbooleanimplements a deepEPPCreditThresholdcompare.Returns the XML namespace associated with theEPPCodecComponent.getType()Gets the type of the credit threshold, which is eitherEPPCreditThreshold.FIXEDorEPPCreditThreshold.PERCENT.getValue()Gets the credit threshold value.voidSets the type of the credit threshold, which is eitherEPPCreditThreshold.FIXEDorEPPCreditThreshold.PERCENT.voidsetValue(BigDecimal aCreditThresholdValue) Sets the credit threshold value.
-
Field Details
-
FIXED
The constant value for FIXED- See Also:
-
PERCENT
The constant value for PERCENT- See Also:
-
-
Constructor Details
-
EPPCreditThreshold
public EPPCreditThreshold()Create a new instance of EPPCreditThreshold. Thetypedefaults toEPPCreditThreshold.FIXEDand thecreditThresholdValuevalue needs to be set viasetValue(BigDecimal)prior to calledencode(Document). -
EPPCreditThreshold
Create a new instance of EPPCreditThreshold with the given threshold type and threshold amount- Parameters:
aType- the type value to use for this instance. Should use one of the static constants defined for this class as a value.aCreditThresholdValue- The threshold amount in a fixed dollar amount ifaTypeisEPPCreditThreshold.FIXEDor in a percentage value ifaTypeisEPPCreditThreshold.PERCENT
-
-
Method Details
-
encode
Append all attributes frm theEPPCreditThresholdto the given DOM Document- 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 report fragment of XML- Throws:
EPPDecodeException- Thrown if any errors occur during decoding.
-
equals
implements a deepEPPCreditThresholdcompare. -
clone
CloneEPPCreditThreshold.- Specified by:
clonein interfaceEPPCodecComponent- Overrides:
clonein classObject- Returns:
- clone of
EPPCreditThreshold - Throws:
CloneNotSupportedException- standard Object.clone exception
-
getType
Gets the type of the credit threshold, which is eitherEPPCreditThreshold.FIXEDorEPPCreditThreshold.PERCENT.EPPCreditThreshold.FIXEDis the default value.- Returns:
- Return either
EPPCreditThreshold.FIXEDorEPPCreditThreshold.PERCENT
-
setType
Sets the type of the credit threshold, which is eitherEPPCreditThreshold.FIXEDorEPPCreditThreshold.PERCENT.- Parameters:
aType- EitherEPPCreditThreshold.FIXEDorEPPCreditThreshold.PERCENT
-
getValue
Gets the credit threshold value.- Returns:
- Credit threshold value if set;
nullotherwise.
-
setValue
Sets the credit threshold value. The value is a fixed dollar amount if thetypeisEPPCreditThreshold.FIXEDand is a percentage of the value if thetypeisEPPCreditThreshold.PERCENT.- Parameters:
aCreditThresholdValue- Credit threshold value.
-
getNamespace
Returns the XML namespace associated with theEPPCodecComponent.- Specified by:
getNamespacein interfaceEPPCodecComponent- Returns:
- XML namespace for the
EPPCodecComponent.
-