Interface RemainingBalance
-
- All Superinterfaces:
Cloneable,DiameterAvp,GroupedAvp
public interface RemainingBalance extends GroupedAvp
Defines an interface representing the Remaining-Balance grouped AVP type. From the Diameter Ro Reference Point Protocol Details (3GPP TS 32.299 V9.6.0) specification:7.2.172 Remaining-Balance AVP The Remaining-Balance AVP (AVPcode 2021) is of type Grouped and provides information about the remaining account balance of the subscriber. It has the following ABNF grammar: Remaining-Balance ::= < AVP Header: 2021 > { Unit-Value } { Currency-Code }Note:
The support for extension AVPs is present even thou the ABNF grammar for this AVP does not contain the "* [ AVP ]" line. Be aware that adding any extension AVPs may result in interoperability problems with products that strongly validate the incoming diameter message for it's adherence to the specification.
-
-
Field Summary
-
Fields inherited from interface org.jainslee.resources.diameter.base.DiameterAvp
FLAG_RULE_MAY, FLAG_RULE_MUST, FLAG_RULE_MUSTNOT
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longgetCurrencyCode()Returns the value of the Currency-Code AVP, of type Unsigned32.DiameterAvp[]getExtensionAvps()Returns the set of extension AVPs.UnitValuegetUnitValue()Returns the value of the Unit-Value AVP, of type Grouped.booleanhasCurrencyCode()Returns true if the Currency-Code AVP is present in the Remaining-Balance AVP.booleanhasUnitValue()Returns true if the Unit-Value AVP is present in the Remaining-Balance AVP.voidremoveCurrencyCode()Removes the Currency-Code AVP from the Remaining-Balance AVP.voidremoveExtensionAvps()Removes all extension AVPs from the Remaining-Balance AVP.voidremoveUnitValue()Removes the Unit-Value AVP from the Remaining-Balance AVP.voidsetCurrencyCode(long currencyCode)Sets the value of the Currency-Code AVP, of type Unsigned32.voidsetExtensionAvps(DiameterAvp[] avps)Sets the set of extension AVPs with all the values in the given array.voidsetUnitValue(UnitValue unitValue)Sets the value of the Unit-Value AVP, of type Grouped.-
Methods inherited from interface org.jainslee.resources.diameter.base.DiameterAvp
byteArrayValue, clone, doubleValue, floatValue, getCode, getMandatoryRule, getName, getProtectedRule, getType, getVendorID, groupedAvpValue, intValue, longValue, stringValue
-
-
-
-
Method Detail
-
hasUnitValue
boolean hasUnitValue()
Returns true if the Unit-Value AVP is present in the Remaining-Balance AVP.
-
getUnitValue
UnitValue getUnitValue()
Returns the value of the Unit-Value AVP, of type Grouped.- Returns:
- the value of the Unit-Value AVP, or null if it has not been set.
-
setUnitValue
void setUnitValue(UnitValue unitValue)
Sets the value of the Unit-Value AVP, of type Grouped.- Throws:
NullPointerException- ifunitValueisnull.
-
removeUnitValue
void removeUnitValue()
Removes the Unit-Value AVP from the Remaining-Balance AVP. If the Unit-Value AVP is not present, this method returns silently.
-
hasCurrencyCode
boolean hasCurrencyCode()
Returns true if the Currency-Code AVP is present in the Remaining-Balance AVP.
-
getCurrencyCode
long getCurrencyCode()
Returns the value of the Currency-Code AVP, of type Unsigned32. UsehasCurrencyCode()to check the existence of this AVP.- Returns:
- the value of the Currency-Code AVP
- Throws:
IllegalStateException- if the Currency-Code AVP has not been set.
-
setCurrencyCode
void setCurrencyCode(long currencyCode)
Sets the value of the Currency-Code AVP, of type Unsigned32.
-
removeCurrencyCode
void removeCurrencyCode()
Removes the Currency-Code AVP from the Remaining-Balance AVP. If the Currency-Code AVP is not present, this method returns silently.
-
getExtensionAvps
DiameterAvp[] getExtensionAvps()
Returns the set of extension AVPs. The returned array contains the extension AVPs in the order they appear in the Remaining-Balance AVP. A return value of null implies that no extensions AVPs have been set.
-
setExtensionAvps
void setExtensionAvps(DiameterAvp[] avps) throws AvpNotAllowedException
Sets the set of extension AVPs with all the values in the given array. The AVPs will be added to Remaining-Balance AVP in the order in which they appear in the array. Note: the array must not be altered by the caller following this call, and getExtensionAvps() is not guaranteed to return the same array instance, e.g. an "==" check would fail.- Throws:
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)NullPointerException- ifavpsisnull.
-
removeExtensionAvps
void removeExtensionAvps()
Removes all extension AVPs from the Remaining-Balance AVP. If no extension AVPs are present, this method returns silently.
-
-