Class ChargingContractItemParameterModel

java.lang.Object
com.highdeal.hci.HCIModelAdapter
com.highdeal.contract.hci.ChargingContractItemParameterModel
All Implemented Interfaces:
ITagNameProvider, IXMLMarshallable, XMLMapping, XMLMarshallable

public class ChargingContractItemParameterModel extends HCIModelAdapter implements XMLMapping
The ChargingContractItemParameterModel inside a ChargingContractItemModel redefines redefines a parameter value of the Charge Component referenced by the ChargingContractItemModel.

It is composed of:

  • A name which identifies only one ChargingContractItemParameterModel inside the Charging Contract Item.
    For a valid redefinition, the Charge Component parameter and the Charging Contract Item Parameter must have the same name and the same type.
  • A defaultValue which is the number or the string or the date that replaces the defaultValue of the Charge Component parameter.

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:complexType name="ChargingContractItemParameterType">
    <xs:sequence>
      <xs:choice>
        <xs:element ref="string" />
        <xs:element ref="date" />
        <xs:element ref="number" />
      </xs:choice>
    </xs:sequence>
    <xs:attribute name="name" type="xs:string" />
  </xs:complexType>

  • Field Details

    • TAG_NAME

      public static final String TAG_NAME
      The value of that constant is the XML tag name of the Charging Contract Item Parameter Model.
      See Also:
  • Constructor Details

    • ChargingContractItemParameterModel

      public ChargingContractItemParameterModel()
  • Method Details

    • getName

      public String getName()
      Gets the name which identifies only one ChargingContractItemParameterModel inside the Charging Contract Item.
      Returns:
      the name which identifies only one ChargingContractItemParameterModel inside the Charging Contract Item.
    • setName

      public void setName(String name)
      Sets the name which identifies only one ChargingContractItemParameterModel inside the Charging Contract Item.
      Parameters:
      name - the name which identifies only one ChargingContractItemParameterModel inside the Charging Contract Item.
    • getType

      public ValueType getType()
      Gets the type of the value. When the type is null, then the value is null. When the value is null, then the type is not necessary null.
      Returns:
      the type of the value
    • setType

      public void setType(ValueType type)
      Sets the type of the value. When the type given in argument is different of the internal type, then the value is set to null.
      Parameters:
      type - the type of the value.
    • getStringValue

      public String getStringValue()
      Gets the value as a String if the type is ValueType.STRING.
      Returns:
      the value as a String if the type is ValueType.STRING, null otherwise.
    • setStringValue

      public void setStringValue(String value)
      Sets a String value and set the type to ValueType.STRING.
      Parameters:
      value - the String value
    • getDateValue

      public Date getDateValue()
      Gets the value as a Date if the type is ValueType.DATE.
      Returns:
      the value as a Date if the type is ValueType.DATE, null otherwise.
    • setDateValue

      public void setDateValue(Date value)
      Sets the Date value and set the type to ValueType.DATE.
      Parameters:
      value - the Date value
    • getNumberValue

      public BigDecimal getNumberValue()
      Gets the value as a BigDecimal if the type is ValueType.NUMBER.
      Returns:
      the value as a BigDecimal if the type is ValueType.NUMBER, null otherwise.
    • setNumberValue

      public void setNumberValue(BigDecimal value)
      Sets the BigDecimal value and set the type to ValueType.NUMBER.
      Parameters:
      value - the BigDecimal value
    • 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
    • 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
    • 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
    • getTagName

      public String getTagName()
      Description copied from interface: ITagNameProvider
      Gets the XML tag name of the HCI model.
      Specified by:
      getTagName in interface ITagNameProvider
      Returns:
      The XML tag name
    • getClass

      public Class<?> getClass(String nsUri, String tag, XMLAttributes atts)
      Description copied from interface: XMLMapping
      Returns the Java class for a specified XML tag and its attributes in a namespace.
      Specified by:
      getClass in interface XMLMapping
      Parameters:
      nsUri - The unique resource identifier of the namespace of the XML tag
      tag - The local part of the XML tag
      atts - The attributes of the XML tag
      Returns:
      A Java class with a default constructor