Class RateModel

java.lang.Object
com.highdeal.pnr.hci.RateModel
All Implemented Interfaces:
IXMLMarshallable, XMLMarshallable, ContextualNode
Direct Known Subclasses:
AccountEventRefillModel, OneShotRateModel, com.highdeal.refilllogic.hci.RefillRecurringRateModel, UsageRateModel

public abstract class RateModel extends Object implements ContextualNode, IXMLMarshallable
This class is the root class for the different rates classes.
  • Constructor Details

    • RateModel

      public RateModel()
  • Method Details

    • getName

      public String getName()
      Gets the name of the rate.
      Returns:
      the name of the rate.
    • setName

      public void setName(String name)
      Sets the name of the rate.
      Parameters:
      name - the name of the rate.
    • getDescription

      public String getDescription()
      Gets the description of the rate.
      Returns:
      the description of the rate.
    • setDescription

      public void setDescription(String description)
      Sets the description of the rate.
      Parameters:
      description - the description of the rate.
    • getRateComponent

      public RateComponentModel getRateComponent()
      Gets the contained rate component.
      Returns:
      the contained rate component.
    • setRateComponent

      public void setRateComponent(RateComponentModel rateComponent)
      Sets the contained rate component.
      Parameters:
      rateComponent - the contained rate component.
    • remove

      public void remove()
      Removes the contained rate component. (This is equivalent to setRateComponent(null).)
    • setParent

      public void setParent(ContextualNode node)
      Sets the parent.
      Specified by:
      setParent in interface ContextualNode
      Parameters:
      node - the parent.
    • getParent

      public ContextualNode getParent()
      Gets the parent node.
      Returns:
      the parent node.
    • inheritedContext

      public RatingContextDescription inheritedContext()
      Gets the inherited context.
      Specified by:
      inheritedContext in interface ContextualNode
      Returns:
      the inherited context.
    • checkValidity

      public boolean checkValidity()
      Returns true if the rate is valid. Rate is valid if all the following conditions are met:
      • The name is not null or empty.
      • The rate component is not null and is valid.
      Returns:
      true if the rate is valid, false otherwise.
    • setAttributes

      public void setAttributes(XMLAttributes atts)
      Description copied from interface: XMLMarshallable
      Sets the attributes of the XML representation of the element being processed.
      Specified by:
      setAttributes in interface XMLMarshallable
      Parameters:
      atts - The XML attributes of the current element
    • addCharacterData

      public void addCharacterData(String cData)
      Description copied from interface: XMLMarshallable
      Adds character data to the content element.
      Specified by:
      addCharacterData in interface XMLMarshallable
      Parameters:
      cData - The character data to be added
    • addChild

      public void addChild(String tagName, XMLMarshallable child)
      Description copied from interface: XMLMarshallable
      Adds a child to the object, the child representing the marshallable object which must be added to the element.
      Specified by:
      addChild in interface XMLMarshallable
      Parameters:
      tagName - The name of tag for the child
      child - The child to be added
    • marshal

      @Deprecated public void marshal(XMLOutputter output)
      Deprecated.
      Description copied from interface: XMLMarshallable
      Gives an XML representation of this object, including its children.
      Specified by:
      marshal in interface IXMLMarshallable
      Specified by:
      marshal in interface XMLMarshallable
      Parameters:
      output - The XML output to marshal the object into
    • marshalAttributes

      public void marshalAttributes(XMLOutputter output)
      Description copied from interface: IXMLMarshallable
      Gives an XML representation of the attributes of an object.
      Specified by:
      marshalAttributes in interface IXMLMarshallable
      Parameters:
      output - The XML output to marshal the object attributes into
    • marshalChildren

      public void marshalChildren(XMLOutputter output)
      Description copied from interface: IXMLMarshallable
      Gives an XML representation of the child objects of an object.
      Specified by:
      marshalChildren in interface IXMLMarshallable
      Parameters:
      output - The XML output to marshal the child objects into