public class PricePlanModel extends Object implements XMLMarshallable, ContextualNode
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="pricePlan">
<xs:complexType>
<xs:sequence>
<xs:element ref="counterDescription" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="parameter" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="usage" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="oneShot" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="recurring" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="chargingPlan" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="description" type="xs:string"/>
<xs:attribute name="freeText" type="xs:string"/>
<xs:attribute name="currency" type="xs:string" use="optional"/> <!-- deprecated -->
</xs:complexType>
</xs:element>
| Constructor and Description |
|---|
PricePlanModel()
Builds an empty PricePlanModel.
|
PricePlanModel(String name,
String description,
String text,
String currencyCode)
Builds a PricePlanModel.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacterData(String cData)
Adds character data to the content element.
|
void |
addChild(String name,
XMLMarshallable child)
Adds a child to the object, the
child representing
the marshallable object which must be added to the element. |
void |
addOneShotRate(OneShotRateModel rate)
Adds a one shot rate.
|
void |
addOneShotRates(Vector<OneShotRateModel> oneShotRates)
Adds one shot rates.
|
void |
addRecurringRate(RecurringRateModel rate)
Adds a recurring rate.
|
void |
addRecurringRates(Vector<RecurringRateModel> recurringRates)
Adds recurring rates.
|
void |
addUsageRate(UsageRateModel rate)
Adds an usage rate.
|
void |
addUsageRates(Vector<UsageRateModel> usageRates)
Adds usage rates.
|
void |
checkChargingPlanCompatibility()
Check if the charging plan is compatible with this price plan.
|
boolean |
checkValidity()
Returns true if the price plan is valid.
|
Vector<CounterDescriptionModel> |
createCounterDescriptions()
Creates the counter descriptions including persistent and transient counters.
|
static void |
findLeaves(RateComponentModel component,
List<RateComponentModel> leaves)
Fill the given list with all leaves starting from the given rate component.
|
ChargingPlanModel |
getChargingPlan()
Gets the charging plan.
|
ChargingPlanDictionaryModel |
getChargingPlanDictionaryModel() |
RatingContextDescription |
getContext(ContextualNode child)
Updates the context for the specified child and returns it.
|
String |
getCurrencyCode()
Deprecated.
|
String |
getDescription()
Gets the description.
|
String |
getFreeText()
Gets the free text.
|
String |
getName()
Gets the name.
|
OneShotRateModel |
getOneShotRate(int index)
Gets a one shot rate.
|
Vector<OneShotRateModel> |
getOneShotRates()
Gets one shot rates.
|
Vector<ParameterModel> |
getParameters()
Gets the parameters.
|
Vector<CounterDescriptionModel> |
getPersistentCounterDescriptions()
Gets the persistent counter descriptions.
|
Vector<ProductModel> |
getProducts()
Gets the products.
|
RecurringRateModel |
getRecurringRate(int index)
Gets a recurring rate.
|
Vector<RecurringRateModel> |
getRecurringRates()
Gets the recurring rates.
|
Vector<CounterDescriptionModel> |
getTransientCounterDescriptions()
Gets the transient counter descriptions.
|
UsageRateModel |
getUsageRate(int index)
Gets an usage rate at a specified index.
|
Vector<UsageRateModel> |
getUsageRates()
Gets the usage rates.
|
RatingContextDescription |
inheritedContext()
Gets the inherited context.
|
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, including its children.
|
void |
removeOneShotRate(int index)
Removes a one shot rate.
|
void |
removeRecurringRate(int index)
Removes a recurring rate.
|
void |
removeUsageRate(int index)
Removes an usage rate.
|
Vector<PropertyDescriptionModel> |
retrieveAllProperties()
Returns all the properties of this price plan.
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the element being
processed.
|
void |
setChargingPlan(ChargingPlanModel chargingPlan)
Sets the
charging plan. |
void |
setChargingPlanDictionaryModel(ChargingPlanDictionaryModel chargingPlanDictionaryModel) |
void |
setContext(RatingContextDescription contextDescription)
Sets the context.
|
void |
setCurrencyCode(String currencyCode)
Deprecated.
|
void |
setDescription(String description)
Sets the description.
|
void |
setFreeText(String text)
Sets the free text.
|
void |
setName(String name)
Sets the name.
|
void |
setParameters(Vector<ParameterModel> p)
Sets the parameters.
|
void |
setParent(ContextualNode node)
Sets the parent.
|
void |
setPersistentCounterDescriptions(Vector<CounterDescriptionModel> counterDescriptions)
Sets the persistent counter descriptions.
|
void |
setProducts(Vector<ProductModel> products)
Sets the products.
|
void |
setTransientCounterDescriptions(Vector<CounterDescriptionModel> counterDescriptions)
Sets the transient counter descriptions.
|
public void setName(String name)
name - the name.public String getName()
public void setDescription(String description)
description - the description.public String getDescription()
public void setFreeText(String text)
text - the free text.public String getFreeText()
@Deprecated public void setCurrencyCode(String currencyCode)
ChargeComponentModel.setCurrencyCode(String).currencyCode - the currency code.@Deprecated public String getCurrencyCode()
ChargeComponentModel.getCurrencyCode().public void setProducts(Vector<ProductModel> products)
products - a Vector of ProductModel.public Vector<ProductModel> getProducts()
ProductModel.public Vector<CounterDescriptionModel> createCounterDescriptions()
CounterDescriptionModel.public void setPersistentCounterDescriptions(Vector<CounterDescriptionModel> counterDescriptions)
counterDescriptions - a Vector of CounterDescriptionModel.public Vector<CounterDescriptionModel> getPersistentCounterDescriptions()
CounterDescriptionModel.public void setTransientCounterDescriptions(Vector<CounterDescriptionModel> counterDescriptions)
counterDescriptions - a Vector of CounterDescriptionModel.public Vector<CounterDescriptionModel> getTransientCounterDescriptions()
CounterDescriptionModel.public Vector<UsageRateModel> getUsageRates()
UsageRateModel.public void addUsageRates(Vector<UsageRateModel> usageRates)
usageRates - a Vector of UsageRateModel.public void addUsageRate(UsageRateModel rate)
rate - the usage rate to add.public void removeUsageRate(int index)
index - the index of the usage rate to be removed.public UsageRateModel getUsageRate(int index)
index - the index of the usage rate to get.public Vector<RecurringRateModel> getRecurringRates()
RecurringRateModel.public void addRecurringRates(Vector<RecurringRateModel> recurringRates)
recurringRates - a Vector of RecurringRateModel.public void addRecurringRate(RecurringRateModel rate)
rate - the recurring rate to add.public void removeRecurringRate(int index)
index - the index of the recurring rate to be removed.public RecurringRateModel getRecurringRate(int index)
index - the index of the recurring rate to get.public Vector<OneShotRateModel> getOneShotRates()
OneShotRateModel.public void addOneShotRates(Vector<OneShotRateModel> oneShotRates)
oneShotRates - a Vector of OneShotRateModel.public void addOneShotRate(OneShotRateModel rate)
rate - the one shot rate to add.public void removeOneShotRate(int index)
index - the index of the one shot rate to be removed.public ChargingPlanModel getChargingPlan()
charging plan.public void setChargingPlan(ChargingPlanModel chargingPlan)
charging plan.chargingPlan - public void checkChargingPlanCompatibility()
throws InvalidInitializationException
InvalidInitializationExceptionpublic void setChargingPlanDictionaryModel(ChargingPlanDictionaryModel chargingPlanDictionaryModel)
public ChargingPlanDictionaryModel getChargingPlanDictionaryModel()
public OneShotRateModel getOneShotRate(int index)
index - the index of the one shot rate to get.public Vector<ParameterModel> getParameters()
ParameterModel.public void setParameters(Vector<ParameterModel> p)
p - a Vector of ParameterModel.public void setParent(ContextualNode node)
setParent in interface ContextualNodenode - the parent (ignored).public RatingContextDescription getContext(ContextualNode child)
getContext in interface ContextualNodechild - public RatingContextDescription inheritedContext()
inheritedContext in interface ContextualNodepublic void setContext(RatingContextDescription contextDescription)
contextDescription - the context.public boolean checkValidity()
public Vector<PropertyDescriptionModel> retrieveAllProperties()
PropertyDescriptionModel that represents all
the properties defined in this price plan.public void setAttributes(XMLAttributes atts)
XMLMarshallablesetAttributes in interface XMLMarshallableatts - The XML attributes of the current elementpublic void addCharacterData(String cData)
XMLMarshallableaddCharacterData in interface XMLMarshallablecData - The character data to be addedpublic void addChild(String name, XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.addChild in interface XMLMarshallablename - The name of tag for the childchild - The child to be addedpublic void marshal(XMLOutputter output)
XMLMarshallablemarshal in interface XMLMarshallableoutput - The XML output to marshal the object intopublic static final void findLeaves(RateComponentModel component, List<RateComponentModel> leaves)
component - the rate component of the start.leaves - the list of all leaves retreived.