Class OfferConditionModel

java.lang.Object
com.highdeal.pnr.hci.OfferConditionModel
All Implemented Interfaces:
XMLMarshallable

public class OfferConditionModel extends Object implements XMLMarshallable
This class represents the information to subscribe and use an offer inside a packaged offer.

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="offerCondition">
   <xs:complexType>
     <xs:sequence>
       <xs:element ref="chargeCondition" minOccurs="0" maxOccurs="unbounded"/>
       <xs:element ref="counterDescription" minOccurs="0" maxOccurs="unbounded"/>
       <xs:element ref="offerConditionContext" minOccurs="0" maxOccurs="1"/>
       <xs:element ref="offerConditionContextChronology" minOccurs="1" maxOccurs="1"/>
     </xs:sequence>
     <xs:attribute name="subCode" type="xs:string" use="required"/>
     <xs:attribute name="offerCode" type="xs:string" use="required"/>
     <xs:attribute name="reference" type="xs:string"/>
     <xs:attribute name="optionalOrder" type="xs:boolean" default="false"/>
     <xs:attribute name="orderMinimum" type="xs:decimal" default="1"/>
     <xs:attribute name="orderMaximum" type="xs:decimal" default="1"/>
     <xs:attribute name="orderStep" type="xs:decimal" default="1"/>
   </xs:complexType>
 </xs:element>

 <xs:element name="offerConditionContextChronology">
   <xs:complexType>
     <xs:sequence>
       <xs:element ref="chronology" minOccurs="1" maxOccurs="1"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>

  • Constructor Details

    • OfferConditionModel

      public OfferConditionModel()
      Builds an empty OfferConditionModel.
  • Method Details

    • getSubCode

      public String getSubCode()
      Returns the sub code of this offerCondition.
      Returns:
      This offerCondition sub code.
      See Also:
    • setSubCode

      public void setSubCode(String code)
      Sets the sub code for this offerCondition.
      Parameters:
      code -
      See Also:
    • getOfferCode

      public String getOfferCode()
      Returns the target offer code of this offer condition.
      Returns:
      This offer condition target offer code.
      See Also:
    • setOfferCode

      public void setOfferCode(String offerCode)
      Sets the target offer code of this offer condition.
      Parameters:
      offerCode -
      See Also:
    • getReference

      public String getReference()
      Returns the reference of this offer condition in the database.
      Returns:
      This offer condition reference.
      See Also:
    • setReference

      public void setReference(String reference)
      Sets the reference of this offer condition.
      Parameters:
      reference -
      See Also:
    • isOptionalOrder

      public boolean isOptionalOrder()
      Returns the optional order flag of this offer condition.
      Returns:
      optional order or not.
      See Also:
    • setOptionalOrder

      public void setOptionalOrder(boolean optionalOrder)
      Sets the optional order flag of this offer condition.
      Parameters:
      optionalOrder -
      See Also:
    • getOrderMinimum

      public int getOrderMinimum()
      Returns the order minimum of this offer condition.
      Returns:
      This offer condition order minimum.
      See Also:
    • setOrderMinimum

      public void setOrderMinimum(int orderMinimum)
      Sets the order minimum of this offer condition.
      Parameters:
      orderMinimum -
      See Also:
    • getOrderMaximum

      public int getOrderMaximum()
      Returns the order maximum of this offer condition.
      Returns:
      This offer condition order maximum.
      See Also:
    • setOrderMaximum

      public void setOrderMaximum(int orderMaximum)
      Sets the order maximum of this offer condition.
      Parameters:
      orderMaximum -
      See Also:
    • getOrderStep

      public int getOrderStep()
      Returns the order step of this offer condition.
      Returns:
      This offer condition order step.
      See Also:
    • setOrderStep

      public void setOrderStep(int orderStep)
      Sets the order step of this offer condition.
      Parameters:
      orderStep -
      See Also:
    • getChargeConditions

      public Vector<ChargeConditionModel> getChargeConditions()
      Returns the list of BusinessRelationshipModel.
      Returns:
      the list of ChargeConditionModel that represents the associated business relationships.
    • getCounterDescriptions

      public Vector<CounterDescriptionModel> getCounterDescriptions()
      Returns the list of CounterDescriptionModel.
      Returns:
      the list of the associated counters.
    • getContextChronology

      public ChronologyModel getContextChronology()
      Returns the context chronology of this offer condition.
      Returns:
      the context in a Chronology.
    • setContext

      public void setContext(OfferConditionContextModel context)
      Sets the offer context of this offer condition.
      Parameters:
      context - the context of this offer condition.
    • getContext

      public OfferConditionContextModel getContext()
      Returns the context of this offer condition.
      Returns:
      the context of this offer condition.
    • setParentOffer

      public void setParentOffer(OfferModel parentOffer)
    • getParentOffer

      public OfferModel getParentOffer()
    • getOfferContextCounters

      public Vector<CounterDescriptionModel> getOfferContextCounters()
      Gets the list of counters that are shared by the offer.
      Returns:
      the list of offer counters.
    • getOfferContextParameters

      public Vector<ParameterModel> getOfferContextParameters(Date date)
      Gets the list of parameters that are shared by the offer. it firstly looks in the edition context and if null, looks in the context chronology at the specified date.
      Parameters:
      date - the date to look in the chronology.
      Returns:
      the list of offer parameters.
    • getOfferContextTranslationInstances

      public Vector<TranslationInstanceModel> getOfferContextTranslationInstances(Date date)
      Gets the list of translation instances that are shared by the offer. it firstly looks in the edition context and if null, looks in the context chronology at the specified date.
      Parameters:
      date - the date to look in the chronology.
      Returns:
      the list of offer instances.
    • getOfferContextTierTableInstances

      public Vector<TierTableInstanceModel> getOfferContextTierTableInstances(Date date)
      Gets the list of tier table instances that are shared by the offer. it firstly looks in the edition context and if null, looks in the context chronology at the specified date.
      Parameters:
      date - the date to look in the chronology.
      Returns:
      the list of offer instances.
    • 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
    • addChild

      public void addChild(String name, 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:
      name - The name of tag for the child
      child - The child to be added
    • 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
    • marshal

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