Class EPPCreditThreshold

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

public class EPPCreditThreshold extends Object implements EPPCodecComponent
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
    Modifier and Type
    Field
    Description
    static final String
    The constant value for FIXED
    static final String
    The constant value for PERCENT
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create 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 Type
    Method
    Description
    Clone EPPCreditThreshold.
    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 attributes frm the EPPCreditThreshold to the given DOM Document
    boolean
    equals(Object aObject)
    implements a deep EPPCreditThreshold compare.
    Returns the XML namespace associated with the EPPCodecComponent.
    Gets the type of the credit threshold, which is either EPPCreditThreshold.FIXED or EPPCreditThreshold.PERCENT.
    Gets the credit threshold value.
    void
    setType(String aType)
    Sets the type of the credit threshold, which is either EPPCreditThreshold.FIXED or EPPCreditThreshold.PERCENT.
    void
    setValue(BigDecimal aCreditThresholdValue)
    Sets the credit threshold value.

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • EPPCreditThreshold

      public EPPCreditThreshold()
      Create a new instance of EPPCreditThreshold. The type defaults to EPPCreditThreshold.FIXED and the creditThresholdValue value needs to be set via setValue(BigDecimal) prior to called encode(Document).
    • EPPCreditThreshold

      public EPPCreditThreshold(String aType, 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 if aType is EPPCreditThreshold.FIXED or in a percentage value if aType is EPPCreditThreshold.PERCENT
  • Method Details

    • encode

      public Element encode(Document aDocument) throws EPPEncodeException
      Append all attributes frm the EPPCreditThreshold 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 report fragment of XML
      Throws:
      EPPDecodeException - Thrown if any errors occur during decoding.
    • equals

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

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

      public String getType()
      Gets the type of the credit threshold, which is either EPPCreditThreshold.FIXED or EPPCreditThreshold.PERCENT. EPPCreditThreshold.FIXED is the default value.
      Returns:
      Return either EPPCreditThreshold.FIXED or EPPCreditThreshold.PERCENT
    • setType

      public void setType(String aType)
      Sets the type of the credit threshold, which is either EPPCreditThreshold.FIXED or EPPCreditThreshold.PERCENT.
      Parameters:
      aType - Either EPPCreditThreshold.FIXED or EPPCreditThreshold.PERCENT
    • getValue

      public BigDecimal getValue()
      Gets the credit threshold value.
      Returns:
      Credit threshold value if set; null otherwise.
    • setValue

      public void setValue(BigDecimal aCreditThresholdValue)
      Sets the credit threshold value. The value is a fixed dollar amount if the type is EPPCreditThreshold.FIXED and is a percentage of the value if the type is EPPCreditThreshold.PERCENT.
      Parameters:
      aCreditThresholdValue - Credit threshold value.
    • getNamespace

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