Interface AocCostInformation

  • All Superinterfaces:
    Cloneable, DiameterAvp, GroupedAvp

    public interface AocCostInformation
    extends GroupedAvp
    Defines an interface representing the AoC-Cost-Information grouped AVP type. From the Diameter Ro Reference Point Protocol Details (3GPP TS 32.299 V9.6.0) specification:
     7.2.13     AoC-Cost-Information AVP
     
     The AoC-Cost-Information AVP (AVP code 2053) is of type Grouped and holds accumulated and incremental cost information for the AoC service
     It has the following ABNF grammar:
     
         AoC-Cost-Information ::=    < AVP Header: 2053 >
                                      [ Accumulated-Cost]
                                    * [ Incremental-Cost ]
                                      [ 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

      • hasAccumulatedCost

        boolean hasAccumulatedCost()
        Returns true if the Accumulated-Cost AVP is present in the AoC-Cost-Information AVP.
      • getAccumulatedCost

        AccumulatedCost getAccumulatedCost()
        Returns the value of the Accumulated-Cost AVP, of type Grouped.
        Returns:
        the value of the Accumulated-Cost AVP, or null if it has not been set.
      • setAccumulatedCost

        void setAccumulatedCost​(AccumulatedCost accumulatedCost)
        Sets the value of the Accumulated-Cost AVP, of type Grouped.
        Throws:
        NullPointerException - if accumulatedCost is null.
      • removeAccumulatedCost

        void removeAccumulatedCost()
        Removes the Accumulated-Cost AVP from the AoC-Cost-Information AVP. If the Accumulated-Cost AVP is not present, this method returns silently.
      • getIncrementalCosts

        IncrementalCost[] getIncrementalCosts()
        Returns the set of Incremental-Cost AVPs. The returned array contains the AVPs in the order they appear in the AoC-Cost-Information AVP. A return value of null implies that no Incremental-Cost AVPs have been set. The elements in the given array are IncrementalCost objects.
      • setIncrementalCost

        void setIncrementalCost​(IncrementalCost incrementalCost)
        Sets a single Incremental-Cost AVP in the AoC-Cost-Information AVP, of type Grouped.
        Throws:
        NullPointerException - if incrementalCost is null.
      • setIncrementalCosts

        void setIncrementalCosts​(IncrementalCost[] incrementalCosts)
        Sets the set of Incremental-Cost AVPs, with all the values in the given array. The AVPs will be added to the AoC-Cost-Information 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 getIncrementalCosts() is not guaranteed to return the same array instance, e.g. an "==" check would fail.
        Throws:
        NullPointerException - if incrementalCosts is null.
      • removeIncrementalCosts

        void removeIncrementalCosts()
        Removes all Incremental-Cost AVPs from the AoC-Cost-Information AVP. If no Incremental-Cost AVPs are present, this method returns silently.
      • hasCurrencyCode

        boolean hasCurrencyCode()
        Returns true if the Currency-Code AVP is present in the AoC-Cost-Information 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 AoC-Cost-Information 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 AoC-Cost-Information 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 AoC-Cost-Information 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 AoC-Cost-Information AVP. If no extension AVPs are present, this method returns silently.