com.highdeal.pnr.hci
Class OfferModel

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

public class OfferModel
extends java.lang.Object
implements XMLMarshallable, ICatalogObject, ITagNameProvider

This Java class represents an offer in master data of a service provider.

See Also:
CreateOfferOp

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>


Constructor Summary
OfferModel()
          Builds an empty OfferModel.
 
Method Summary
 void addCharacterData(java.lang.String cData)
          Adds character data to the content element.
 ChargeConditionModel addCharge(ChargeComponentModel charge)
           
 void addChild(java.lang.String name, XMLMarshallable child)
          Adds a child to the object, the child representing the marshallable object which must be added to the element.
 OfferConditionModel addSubOffer(OfferModel offer)
           
 boolean doesChargeDependenciesContainsCycle()
           
 java.util.Vector<AdditionalInfoModel> getAdditionalInfos()
          Returns the list of AdditionalInfoModel.
 java.util.Vector<ChargeConditionModel> getChargeConditions()
          Returns the list of ChargeConditionModel.
 java.util.Vector<ChargeDependencyModel> getChargeDependencies()
          Returns the list of ChargeDependencyModel.
 java.lang.String getCode()
          Returns the code of this offer.
 OfferContextModel getContext()
          Returns the offer context of this offer.
 ChronologyModel getContextChronology()
          Returns the offer context chronology of this offer.
 java.util.Vector<CounterDescriptionModel> getCounterDescriptions()
          Returns the list of the associated counter descriptions.
 java.util.Date getEffective()
          Returns the effective date of this offer.
 java.util.Date getExpiration()
          Returns the expiration date of this offer.
 java.lang.String getLongDescription()
          Returns the long description of this offer.
 java.util.Vector<OfferConditionModel> getOfferConditions()
          Returns the list of OfferConditionModel.
 java.lang.String getOwner()
          Returns the owner of this offer.
 java.lang.String getReference()
          Returns the reference of this offer.
 java.lang.String getShortDescription()
          Returns the short description of this offer.
 java.lang.String getTagName()
          Gets the XML tag name of the HCI model.
 void marshal(XMLOutputter output)
          Gives an XML representation of this object, including its children.
 java.util.Vector<ChargeConditionModel> retrieveAllChargeConditions()
          Returns the charge conditions of this offer and all the charge conditions of its offer conditions.
 java.util.Vector<ChargeConditionModel> retrieveInvalidChargeSubCodes()
          Checks that the sub codes of the charge conditions are unique.
 java.util.Vector<OfferConditionModel> retrieveInvalidOfferConditionSubCodes()
          Checks that the sub codes of the offer conditions are unique.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the element being processed.
 void setCode(java.lang.String code)
          Sets the code for this offer.
 void setContext(OfferContextModel context)
          Sets the offer context of this offer.
 void setEffective(java.util.Date effective)
          Sets the effective date of this offer.
 void setExpiration(java.util.Date expiration)
          Sets the expiration date of this offer.
 void setLongDescription(java.lang.String description)
          Sets the long description of this offer.
 void setOwner(java.lang.String owner)
          Sets the owner of this offer.
 void setReference(java.lang.String reference)
          Sets the reference of this offer.
 void setShortDescription(java.lang.String description)
          Sets the short description of this offer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OfferModel

public OfferModel()
Builds an empty OfferModel.

Method Detail

getCode

public java.lang.String getCode()
Returns the code of this offer.

Returns:
This offer code
See Also:
setCode(String)

setCode

public void setCode(java.lang.String code)
Sets the code for this offer.

Parameters:
code - the code for this offer
See Also:
getCode()

getReference

public java.lang.String getReference()
Returns the reference of this offer.

Returns:
This offer reference
See Also:
setReference(String)

setReference

public void setReference(java.lang.String reference)
Sets the reference of this offer.

Parameters:
reference - The reference of this offer
See Also:
getReference()

getOwner

public java.lang.String getOwner()
Returns the owner of this offer.

Specified by:
getOwner in interface ICatalogObject
Returns:
This offer owner
See Also:
setOwner(String)

setOwner

public void setOwner(java.lang.String owner)
Sets the owner of this offer.

Parameters:
owner - The owner of this offer
See Also:
getOwner()

getShortDescription

public java.lang.String getShortDescription()
Returns the short description of this offer.

Returns:
This offer short description
See Also:
setShortDescription(String)

setShortDescription

public void setShortDescription(java.lang.String description)
Sets the short description of this offer.

Parameters:
description - The short description of this offer
See Also:
getShortDescription()

getLongDescription

public java.lang.String getLongDescription()
Returns the long description of this offer.

Returns:
This offer long description
See Also:
setLongDescription(String)

setLongDescription

public void setLongDescription(java.lang.String description)
Sets the long description of this offer.

Parameters:
description - The long description of this offer
See Also:
getLongDescription()

getEffective

public java.util.Date getEffective()
Returns the effective date of this offer.

Returns:
This offer effective date
See Also:
setEffective(Date)

setEffective

public void setEffective(java.util.Date effective)
Sets the effective date of this offer.

Parameters:
effective - The effective date of this offer
See Also:
getEffective()

getExpiration

public java.util.Date getExpiration()
Returns the expiration date of this offer.

Returns:
This offer expiration date
See Also:
setExpiration(Date)

setExpiration

public void setExpiration(java.util.Date expiration)
Sets the expiration date of this offer.

Parameters:
expiration - The expiration date of this offer
See Also:
getExpiration()

getOfferConditions

public java.util.Vector<OfferConditionModel> getOfferConditions()
Returns the list of OfferConditionModel.

Returns:
A list of OfferConditionModel that represents the associated offer conditions

getChargeConditions

public java.util.Vector<ChargeConditionModel> getChargeConditions()
Returns the list of ChargeConditionModel.

Returns:
A list of ChargeConditionModel that represents the associated charge conditions

getAdditionalInfos

public java.util.Vector<AdditionalInfoModel> getAdditionalInfos()
Returns the list of AdditionalInfoModel.

Returns:
A list of AdditionalInfoModel that represents the associated additional info

getCounterDescriptions

public java.util.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 java.util.Vector<ChargeDependencyModel> getChargeDependencies()
Returns the list of ChargeDependencyModel.

Returns:
A list of ChargeDependencyModel that represents the associated charge dependencies

getTagName

public java.lang.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(java.lang.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(java.lang.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 java.util.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 java.util.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 java.util.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.

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)