Interface CcMoney
-
- All Superinterfaces:
Cloneable
,DiameterAvp
,GroupedAvp
public interface CcMoney extends GroupedAvp
Defines an interface representing the CC-Money grouped AVP type. From the Diameter Credit-Control Application (rfc4006.txt) specification:8.22. CC-Money AVP The CC-Money AVP (AVP Code 413) is of type Grouped and specifies the monetary amount in the given currency. The Currency-Code AVP SHOULD be included. It is defined as follows (per the grouped-avp-def of RFC 3588 [DIAMBASE]): CC-Money ::= < AVP Header: 413 > { 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 long
getCurrencyCode()
Returns the value of the Currency-Code AVP, of type Unsigned32.DiameterAvp[]
getExtensionAvps()
Returns the set of extension AVPs.UnitValue
getUnitValue()
Returns the value of the Unit-Value AVP, of type Grouped.boolean
hasCurrencyCode()
Returns true if the Currency-Code AVP is present in the CC-Money AVP.boolean
hasUnitValue()
Returns true if the Unit-Value AVP is present in the CC-Money AVP.void
removeCurrencyCode()
Removes the Currency-Code AVP from the CC-Money AVP.void
removeExtensionAvps()
Removes all extension AVPs from the CC-Money AVP.void
removeUnitValue()
Removes the Unit-Value AVP from the CC-Money 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
setUnitValue(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 CC-Money 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
- ifunitValue
isnull
.
-
removeUnitValue
void removeUnitValue()
Removes the Unit-Value AVP from the CC-Money 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 CC-Money 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 CC-Money 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 CC-Money 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 CC-Money 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
- ifavps
isnull
.
-
removeExtensionAvps
void removeExtensionAvps()
Removes all extension AVPs from the CC-Money AVP. If no extension AVPs are present, this method returns silently.
-
-