public interface UnitValue extends GroupedAvp
8.8. Unit-Value AVP Unit-Value AVP is of type Grouped (AVP Code 445) and specifies the units as decimal value. The Unit-Value is a value with an exponent; i.e., Unit-Value = Value-Digits AVP * 10^Exponent. This representation avoids unwanted rounding off. For example, the value of 2,3 is represented as Value-Digits = 23 and Exponent = -1. The absence of the exponent part MUST be interpreted as an exponent equal to zero. It is defined as follows (per the grouped-avp-def of RFC 3588 [DIAMBASE]): Unit-Value ::= < AVP Header: 445 > { Value-Digits } [ Exponent ]
FLAG_RULE_MAY, FLAG_RULE_MUST, FLAG_RULE_MUSTNOT
Modifier and Type | Method and Description |
---|---|
int |
getExponent()
Returns the value of the Exponent AVP, of type Integer32.
|
long |
getValueDigits()
Returns the value of the Value-Digits AVP, of type Integer64.
|
boolean |
hasExponent()
Returns true if the Exponent AVP is present in the Unit-Value AVP.
|
boolean |
hasValueDigits()
Returns true if the Value-Digits AVP is present in the Unit-Value AVP.
|
void |
removeExponent()
Removes the Exponent AVP from the Unit-Value AVP.
|
void |
removeValueDigits()
Removes the Value-Digits AVP from the Unit-Value AVP.
|
void |
setExponent(int exponent)
Sets the value of the Exponent AVP, of type Integer32.
|
void |
setValueDigits(long valueDigits)
Sets the value of the Value-Digits AVP, of type Integer64.
|
byteArrayValue, clone, doubleValue, floatValue, getCode, getMandatoryRule, getName, getProtectedRule, getType, getVendorID, groupedAvpValue, intValue, longValue, stringValue
boolean hasValueDigits()
long getValueDigits()
hasValueDigits()
to check the existence of this AVP.java.lang.IllegalStateException
- if the Value-Digits AVP has not been set.void setValueDigits(long valueDigits)
void removeValueDigits()
boolean hasExponent()
int getExponent()
hasExponent()
to check the existence of this AVP.java.lang.IllegalStateException
- if the Exponent AVP has not been set.void setExponent(int exponent)
void removeExponent()