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 V8.13.0) specification:
     7.2.133     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.
    • 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 - if unitValue is null.
      • 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. Use hasCurrencyCode() 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 - if avps is null.
      • removeExtensionAvps

        void removeExtensionAvps()
        Removes all extension AVPs from the Remaining-Balance AVP. If no extension AVPs are present, this method returns silently.