Class OfferModel

java.lang.Object
com.highdeal.pnr.hci.OfferModel
All Implemented Interfaces:
ITagNameProvider, XMLMarshallable, ICatalogObject

public class OfferModel extends Object implements XMLMarshallable, ICatalogObject, ITagNameProvider
This Java class represents an offer in master data of a service provider.
See Also:

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="offer">
   <xs:complexType>
     <xs:sequence>
       <xs:element ref="offerContext" minOccurs="0" maxOccurs="1"/>
       <xs:element ref="offerCondition" minOccurs="0" maxOccurs="unbounded"/>
       <xs:element ref="chargeCondition" minOccurs="0" maxOccurs="unbounded"/>
       <xs:element ref="additionalInformation" minOccurs="0" maxOccurs="unbounded"/>
       <xs:element ref="chargeDependency" minOccurs="0" maxOccurs="unbounded"/>
       <xs:element ref="counterDescription" minOccurs="0" maxOccurs="unbounded"/>
       <xs:element ref="offerContextChronology" minOccurs="1" maxOccurs="1"/>
     </xs:sequence>
     <xs:attribute name="code" type="xs:string" use="required"/>
     <xs:attribute name="reference" type="xs:string"/>
     <xs:attribute name="owner" type="xs:string" use="required"/>
     <xs:attribute name="shortDescription" type="xs:string"/>
     <xs:attribute name="longDescription" type="xs:string"/>
     <xs:attribute name="effective" type="xs:dateTime" use="required"/>
     <xs:attribute name="expiration" type="xs:dateTime"/>
   </xs:complexType>
 </xs:element>

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

  • Field Details

    • TAG_NAME

      public static final String TAG_NAME
      The value of that constant is the XML tag name of the Offer.
      See Also:
  • Constructor Details

    • OfferModel

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

    • getCode

      public String getCode()
      Returns the code of this offer.
      Returns:
      This offer code
      See Also:
    • setCode

      public void setCode(String code)
      Sets the code for this offer.
      Parameters:
      code - the code for this offer
      See Also:
    • getReference

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

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

      public String getOwner()
      Returns the owner of this offer.
      Specified by:
      getOwner in interface ICatalogObject
      Returns:
      This offer owner
      See Also:
    • setOwner

      public void setOwner(String owner)
      Sets the owner of this offer.
      Parameters:
      owner - The owner of this offer
      See Also:
    • getShortDescription

      public String getShortDescription()
      Returns the short description of this offer.
      Returns:
      This offer short description
      See Also:
    • setShortDescription

      public void setShortDescription(String description)
      Sets the short description of this offer.
      Parameters:
      description - The short description of this offer
      See Also:
    • getLongDescription

      public String getLongDescription()
      Returns the long description of this offer.
      Returns:
      This offer long description
      See Also:
    • setLongDescription

      public void setLongDescription(String description)
      Sets the long description of this offer.
      Parameters:
      description - The long description of this offer
      See Also:
    • getEffective

      public Date getEffective()
      Returns the effective date of this offer.
      Returns:
      This offer effective date
      See Also:
    • setEffective

      public void setEffective(Date effective)
      Sets the effective date of this offer.
      Parameters:
      effective - The effective date of this offer
      See Also:
    • getExpiration

      public Date getExpiration()
      Returns the expiration date of this offer.
      Returns:
      This offer expiration date
      See Also:
    • setExpiration

      public void setExpiration(Date expiration)
      Sets the expiration date of this offer.
      Parameters:
      expiration - The expiration date of this offer
      See Also:
    • getOfferConditions

      public Vector<OfferConditionModel> getOfferConditions()
      Returns the list of OfferConditionModel.
      Returns:
      A list of OfferConditionModel that represents the associated offer conditions
    • getChargeConditions

      public Vector<ChargeConditionModel> getChargeConditions()
      Returns the list of ChargeConditionModel.
      Returns:
      A list of ChargeConditionModel that represents the associated charge conditions
    • getAdditionalInfos

      public Vector<AdditionalInfoModel> getAdditionalInfos()
      Returns the list of AdditionalInfoModel.
      Returns:
      A list of AdditionalInfoModel that represents the associated additional info
    • getCounterDescriptions

      public Vector<CounterDescriptionModel> getCounterDescriptions()
      Returns the list of the associated counter descriptions.
      Returns:
      A list of CounterDescriptionModel that represents the associated counter descriptions
    • getContextChronology

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

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

      public OfferContextModel getContext()
      Returns the offer context of this offer.
      Returns:
      The offer context of this offer
    • getChargeDependencies

      public Vector<ChargeDependencyModel> getChargeDependencies()
      Returns the list of ChargeDependencyModel.
      Returns:
      A list of ChargeDependencyModel that represents the associated charge dependencies
    • 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
    • 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
    • addSubOffer

      public OfferConditionModel addSubOffer(OfferModel offer)
    • addCharge

      public ChargeConditionModel addCharge(ChargeComponentModel charge)
    • doesChargeDependenciesContainsCycle

      public boolean doesChargeDependenciesContainsCycle()
    • retrieveAllChargeConditions

      public Vector<ChargeConditionModel> retrieveAllChargeConditions()
      Returns the charge conditions of this offer and all the charge conditions of its offer conditions.
      Returns:
      A list of ChargeConditionModel
    • retrieveInvalidOfferConditionSubCodes

      public Vector<OfferConditionModel> retrieveInvalidOfferConditionSubCodes()
      Checks that the sub codes of the offer conditions are unique.
      Returns:
      The list of string that represents the duplicated sub codes if exists. The list is empty if it doesn't exist duplicated sub code.
    • retrieveInvalidChargeSubCodes

      public Vector<ChargeConditionModel> retrieveInvalidChargeSubCodes()
      Checks that the sub codes of the charge conditions are unique. The check scope includes the chargeConditions of this offer and all the charge conditions of the offerConditions of this offer.
      Returns:
      The list of string that represents the duplicated sub codes if exists. The list is empty if it doesn't exist duplicated sub code.