public interface NextTariff extends GroupedAvp
7.2.112 Next-Tariff AVP The Next-Tariff AVP (AVP code 2057) is of type Grouped and holds tariff information. The Tariff is a formula for cost calculation given the Used-Service-Unit AVP. The calculated cost is given in the Currency-Code AVP. The formula sums all the rating elements and multiplies the sum by the Scale-Factor AVP. It has the following ABNF grammar: Next-Tariff ::= < AVP Header: 2057 > [ Currency-Code ] [ Scale-Factor ] *[ Rate-Element ]Note:
FLAG_RULE_MAY, FLAG_RULE_MUST, FLAG_RULE_MUSTNOT
Modifier and Type | Method and Description |
---|---|
long |
getCurrencyCode()
Returns the value of the Currency-Code AVP, of type Unsigned32.
|
DiameterAvp[] |
getExtensionAvps()
Returns the set of extension AVPs.
|
RateElement[] |
getRateElements()
Returns the set of Rate-Element AVPs.
|
ScaleFactor |
getScaleFactor()
Returns the value of the Scale-Factor AVP, of type Grouped.
|
boolean |
hasCurrencyCode()
Returns true if the Currency-Code AVP is present in the Next-Tariff AVP.
|
boolean |
hasScaleFactor()
Returns true if the Scale-Factor AVP is present in the Next-Tariff AVP.
|
void |
removeCurrencyCode()
Removes the Currency-Code AVP from the Next-Tariff AVP.
|
void |
removeExtensionAvps()
Removes all extension AVPs from the Next-Tariff AVP.
|
void |
removeRateElements()
Removes all Rate-Element AVPs from the Next-Tariff AVP.
|
void |
removeScaleFactor()
Removes the Scale-Factor AVP from the Next-Tariff AVP.
|
void |
setCurrencyCode(long currencyCode)
Sets the value of the Currency-Code AVP, of type Unsigned32.
|
void |
setExtensionAvps(DiameterAvp[] avps)
Sets the set of extension AVPs with all the values in the given array.
|
void |
setRateElement(RateElement rateElement)
Sets a single Rate-Element AVP in the Next-Tariff AVP, of type Grouped.
|
void |
setRateElements(RateElement[] rateElements)
Sets the set of Rate-Element AVPs, with all the values in the given array.
|
void |
setScaleFactor(ScaleFactor scaleFactor)
Sets the value of the Scale-Factor AVP, of type Grouped.
|
byteArrayValue, clone, doubleValue, floatValue, getCode, getMandatoryRule, getName, getProtectedRule, getType, getVendorID, groupedAvpValue, intValue, longValue, stringValue
boolean hasCurrencyCode()
long getCurrencyCode()
hasCurrencyCode()
to check the existence of this AVP.java.lang.IllegalStateException
- if the Currency-Code AVP has not been set.void setCurrencyCode(long currencyCode)
void removeCurrencyCode()
boolean hasScaleFactor()
ScaleFactor getScaleFactor()
void setScaleFactor(ScaleFactor scaleFactor)
java.lang.NullPointerException
- if scaleFactor
is null
.void removeScaleFactor()
RateElement[] getRateElements()
void setRateElement(RateElement rateElement)
java.lang.NullPointerException
- if rateElement
is null
.void setRateElements(RateElement[] rateElements)
java.lang.NullPointerException
- if rateElements
is null
.void removeRateElements()
DiameterAvp[] getExtensionAvps()
void setExtensionAvps(DiameterAvp[] avps) throws AvpNotAllowedException
AvpNotAllowedException
- if an AVP is encountered of a type already known to this class
(i.e. an AVP for which get/set methods already appear in this class)java.lang.NullPointerException
- if avps
is null
.void removeExtensionAvps()