Class AvpList

All Implemented Interfaces:
Serializable, Iterable<Avp>, Collection<Avp>, List<Avp>

public final class AvpList extends AbstractList<Avp> implements Serializable
An AvpList is used to represent the AVPs of a Diameter message or the AVPs contained within a grouped AVP.
Author:
Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
See Also:
  • Constructor Details

    • AvpList

      public AvpList()
      Creates a new empty AvpList.
    • AvpList

      public AvpList(Avp[] avps)
  • Method Details

    • decode

      public void decode(ByteBuffer bb)
    • encode

      public ByteBuffer encode(ByteBuffer bb)
    • get

      public Avp get(Attribute attr)
      Returns the first AVP for the specified Attribute, or null if none.
      Parameters:
      attr - the Attribute to search for
      Returns:
      the AVP with the attribute, or null if none
    • get

      public Avp get(String name)
      Returns the first AVP for the specific attribute name, or null if none
      Parameters:
      name - the attribute name
      Returns:
      the AVP with the attribute, or null if none
    • getLast

      public Avp getLast(Attribute attr)
      Returns the last AVP for the specified Attribute, or null if none.
      Parameters:
      attr - the Attribute to search for
      Returns:
      the last AVP with the Attribute, or null if none
    • add

      public void add(Attribute attr, Object value)
      Adds a new AVP to the list of AVPs.
      Parameters:
      attr - the AVP attribute
      value - the AVP value
      See Also:
    • add

      public void add(String name, Object value)
      Adds a new AVP by name to the list of AVPs.
      Parameters:
      name - the AVP attribute name
      value - the AVP value
    • get

      public Avp get(int i)
      Specified by:
      get in interface List<Avp>
      Specified by:
      get in class AbstractList<Avp>
    • size

      public int size()
      Specified by:
      size in interface Collection<Avp>
      Specified by:
      size in interface List<Avp>
      Specified by:
      size in class AbstractCollection<Avp>
    • set

      public Avp set(int i, Avp avp)
      Specified by:
      set in interface List<Avp>
      Overrides:
      set in class AbstractList<Avp>
    • add

      public void add(int i, Avp avp)
      Specified by:
      add in interface List<Avp>
      Overrides:
      add in class AbstractList<Avp>
    • remove

      public Avp remove(int i)
      Specified by:
      remove in interface List<Avp>
      Overrides:
      remove in class AbstractList<Avp>
    • toString

      public String toString()
      Overrides:
      toString in class AbstractCollection<Avp>
    • appendXml

      public XmlBuffer appendXml(XmlBuffer xb)