Package com.verisign.epp.codec.balance
Class EPPCreditThreshold
- java.lang.Object
-
- com.verisign.epp.codec.balance.EPPCreditThreshold
-
- All Implemented Interfaces:
EPPCodecComponent
,java.io.Serializable
,java.lang.Cloneable
public class EPPCreditThreshold extends java.lang.Object implements EPPCodecComponent
TheEPPCreditThreshold
is theEPPCodecComponent
that knows how to encode and decode Credit Threshold Type elements from/to XML and object instance.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EPPCreditThreshold()
Create a new instance of EPPCreditThreshold.EPPCreditThreshold(java.lang.String aType, java.math.BigDecimal aCreditThresholdValue)
Create a new instance of EPPCreditThreshold with the given threshold type and threshold amount
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
CloneEPPCreditThreshold
.void
decode(org.w3c.dom.Element aElement)
Populate the data of this instance with the data stored in the given Element of the DOM tree.org.w3c.dom.Element
encode(org.w3c.dom.Document aDocument)
Append all attributes frm theEPPCreditThreshold
to the given DOM Documentboolean
equals(java.lang.Object aObject)
implements a deepEPPCreditThreshold
compare.java.lang.String
getNamespace()
Returns the XML namespace associated with theEPPCodecComponent
.java.lang.String
getType()
Gets the type of the credit threshold, which is eitherEPPCreditThreshold.FIXED
orEPPCreditThreshold.PERCENT
.java.math.BigDecimal
getValue()
Gets the credit threshold value.void
setType(java.lang.String aType)
Sets the type of the credit threshold, which is eitherEPPCreditThreshold.FIXED
orEPPCreditThreshold.PERCENT
.void
setValue(java.math.BigDecimal aCreditThresholdValue)
Sets the credit threshold value.
-
-
-
Field Detail
-
FIXED
public static final java.lang.String FIXED
The constant value for FIXED- See Also:
- Constant Field Values
-
PERCENT
public static final java.lang.String PERCENT
The constant value for PERCENT- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EPPCreditThreshold
public EPPCreditThreshold()
Create a new instance of EPPCreditThreshold. Thetype
defaults toEPPCreditThreshold.FIXED
and thecreditThresholdValue
value needs to be set viasetValue(BigDecimal)
prior to calledencode(Document)
.
-
EPPCreditThreshold
public EPPCreditThreshold(java.lang.String aType, java.math.BigDecimal aCreditThresholdValue)
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 ifaType
isEPPCreditThreshold.FIXED
or in a percentage value ifaType
isEPPCreditThreshold.PERCENT
-
-
Method Detail
-
encode
public org.w3c.dom.Element encode(org.w3c.dom.Document aDocument) throws EPPEncodeException
Append all attributes frm theEPPCreditThreshold
to the given DOM Document- Specified by:
encode
in 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
public void decode(org.w3c.dom.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 interfaceEPPCodecComponent
- Parameters:
aElement
- The root element of the report fragment of XML- Throws:
EPPDecodeException
- Thrown if any errors occur during decoding.
-
equals
public boolean equals(java.lang.Object aObject)
implements a deepEPPCreditThreshold
compare.- Overrides:
equals
in classjava.lang.Object
- Parameters:
aObject
-EPPCreditThreshold
instance to compare with- Returns:
- true if equal false otherwise
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
CloneEPPCreditThreshold
.- Specified by:
clone
in interfaceEPPCodecComponent
- Overrides:
clone
in classjava.lang.Object
- Returns:
- clone of
EPPCreditThreshold
- Throws:
java.lang.CloneNotSupportedException
- standard Object.clone exception
-
getType
public java.lang.String getType()
Gets the type of the credit threshold, which is eitherEPPCreditThreshold.FIXED
orEPPCreditThreshold.PERCENT
.EPPCreditThreshold.FIXED
is the default value.- Returns:
- Return either
EPPCreditThreshold.FIXED
orEPPCreditThreshold.PERCENT
-
setType
public void setType(java.lang.String aType)
Sets the type of the credit threshold, which is eitherEPPCreditThreshold.FIXED
orEPPCreditThreshold.PERCENT
.- Parameters:
aType
- EitherEPPCreditThreshold.FIXED
orEPPCreditThreshold.PERCENT
-
getValue
public java.math.BigDecimal getValue()
Gets the credit threshold value.- Returns:
- Credit threshold value if set;
null
otherwise.
-
setValue
public void setValue(java.math.BigDecimal aCreditThresholdValue)
Sets the credit threshold value. The value is a fixed dollar amount if thetype
isEPPCreditThreshold.FIXED
and is a percentage of the value if thetype
isEPPCreditThreshold.PERCENT
.- Parameters:
aCreditThresholdValue
- Credit threshold value.
-
getNamespace
public java.lang.String getNamespace()
Returns the XML namespace associated with theEPPCodecComponent
.- Specified by:
getNamespace
in interfaceEPPCodecComponent
- Returns:
- XML namespace for the
EPPCodecComponent
.
-
-