|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.diameter.charging.util.UnitValue
public class UnitValue
UnitValue is a lightweight representation of the Grouped [Unit-Value] Avp. It specifies the number of units as a decimal value with an exponent.
The [Unit-Value] Avp is defined in RFC 4006 - Diameter Credit-Control Application.
Constructor Summary | |
---|---|
UnitValue()
Constructs an empty UnitValue object representing the [Unit-Value] Avp. |
|
UnitValue(java.util.List<Avp> avps)
Constructs a UnitValue object representing the Grouped [Unit-Value] Avp. |
Method Summary | |
---|---|
java.lang.Integer |
getExponent()
Gets the value corresponding to the payload of the [Exponent] Avp. |
java.lang.Long |
getValueDigits()
Gets the value corresponding to the payload of the [Value-Digits] Avp. |
void |
setExponent(java.lang.Integer exponent)
Sets the value corresponding to the payload of the [Exponent] Avp. |
void |
setValueDigits(java.lang.Long valueDigits)
Sets the value corresponding to the payload of the [Value-Digitse] Avp. |
Avp |
toAvp()
Transforms a UnitValue object into a Grouped [Unit-Value] Avp. |
void |
validate()
Validates the members of the UnitValue object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UnitValue()
public UnitValue(java.util.List<Avp> avps) throws AvpTransformationException
The method takes a List of Avps as an input. If an Avp code inside the list corresponds to a member of UnitValue, the member will be populated with the Avp value during construction. If an Avp code is unknown, the value will be silently discarded.
avps
- a list of Avps that can appear in the Grouped
[Unit-Value] Avp.
AvpTransformationException
- if the Avp value is in an unexpected format.Method Detail |
---|
public java.lang.Integer getExponent()
public void setExponent(java.lang.Integer exponent)
exponent
- the value corresponding to the payload of the [Exponent] Avp.public java.lang.Long getValueDigits()
public void setValueDigits(java.lang.Long valueDigits)
valueDigits
- the value corresponding to the payload of the [Value-Digits] Avp.public void validate() throws ChargingValidationException
ChargingValidationException
- if a member of UnitValue is in an unexpected format.public Avp toAvp() throws AvpTransformationException
All non-null members of UnitValue will be transformed into Avps nested inside of the [Unit-Value] Avp.
AvpTransformationException
- if a member of UnitValue is in an
unexpected format.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |