Interface RateElement

  • All Superinterfaces:
    Cloneable, DiameterAvp, GroupedAvp

    public interface RateElement
    extends GroupedAvp
    Defines an interface representing the Rate-Element grouped AVP type. From the Diameter Rf Reference Point Protocol Details (3GPP TS 32.299 V9.6.0) specification:
     7.2.161 Rate-Element AVP
     The Rate-Element AVP (AVP code 2058) is of type Grouped and holds simple rate element of one dimension.
     Possible dimensions are the CC-Unit-Type.
     It has the following ABNF grammar:
     
         Rate-Element    ::=     < AVP Header: 2058 >
                                 { CC-Unit-Type }
                                 [ Reason-Code ]
                                 [ Unit-Value ]
                                 [ Unit-Cost ]
                                 [ Unit-Quota-Threshold ]
     
    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

      • hasCcUnitType

        boolean hasCcUnitType()
        Returns true if the CC-Unit-Type AVP is present in the Rate-Element AVP.
      • getCcUnitType

        CcUnitType getCcUnitType()
        Returns the value of the CC-Unit-Type AVP, of type Enumerated.
        Returns:
        the value of the CC-Unit-Type AVP, or null if it has not been set.
      • setCcUnitType

        void setCcUnitType​(CcUnitType ccUnitType)
        Sets the value of the CC-Unit-Type AVP, of type Enumerated.
        Throws:
        NullPointerException - if ccUnitType is null.
      • removeCcUnitType

        void removeCcUnitType()
        Removes the CC-Unit-Type AVP from the Rate-Element AVP. If the CC-Unit-Type AVP is not present, this method returns silently.
      • hasReasonCode

        boolean hasReasonCode()
        Returns true if the Reason-Code AVP is present in the Rate-Element AVP.
      • getReasonCode

        ReasonCode getReasonCode()
        Returns the value of the Reason-Code AVP, of type Enumerated.
        Returns:
        the value of the Reason-Code AVP, or null if it has not been set.
      • setReasonCode

        void setReasonCode​(ReasonCode reasonCode)
        Sets the value of the Reason-Code AVP, of type Enumerated.
        Throws:
        NullPointerException - if reasonCode is null.
      • removeReasonCode

        void removeReasonCode()
        Removes the Reason-Code AVP from the Rate-Element AVP. If the Reason-Code AVP is not present, this method returns silently.
      • hasUnitValue

        boolean hasUnitValue()
        Returns true if the Unit-Value AVP is present in the Rate-Element 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 Rate-Element AVP. If the Unit-Value AVP is not present, this method returns silently.
      • hasUnitCost

        boolean hasUnitCost()
        Returns true if the Unit-Cost AVP is present in the Rate-Element AVP.
      • getUnitCost

        UnitCost getUnitCost()
        Returns the value of the Unit-Cost AVP, of type Grouped.
        Returns:
        the value of the Unit-Cost AVP, or null if it has not been set.
      • setUnitCost

        void setUnitCost​(UnitCost unitCost)
        Sets the value of the Unit-Cost AVP, of type Grouped.
        Throws:
        NullPointerException - if unitCost is null.
      • removeUnitCost

        void removeUnitCost()
        Removes the Unit-Cost AVP from the Rate-Element AVP. If the Unit-Cost AVP is not present, this method returns silently.
      • hasUnitQuotaThreshold

        boolean hasUnitQuotaThreshold()
        Returns true if the Unit-Quota-Threshold AVP is present in the Rate-Element AVP.
      • getUnitQuotaThreshold

        long getUnitQuotaThreshold()
        Returns the value of the Unit-Quota-Threshold AVP, of type Unsigned32. Use hasUnitQuotaThreshold() to check the existence of this AVP.
        Returns:
        the value of the Unit-Quota-Threshold AVP
        Throws:
        IllegalStateException - if the Unit-Quota-Threshold AVP has not been set.
      • setUnitQuotaThreshold

        void setUnitQuotaThreshold​(long unitQuotaThreshold)
        Sets the value of the Unit-Quota-Threshold AVP, of type Unsigned32.
      • removeUnitQuotaThreshold

        void removeUnitQuotaThreshold()
        Removes the Unit-Quota-Threshold AVP from the Rate-Element AVP. If the Unit-Quota-Threshold 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 Rate-Element 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 Rate-Element 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 Rate-Element AVP. If no extension AVPs are present, this method returns silently.