public final class Avp extends Object implements Serializable
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | AVP Code | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |V M P r r r r r| AVP Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Vendor-ID (opt) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... Data ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Constructor and Description |
---|
Avp(Attribute attr,
Object value)
Creates a new AVP for the specified Attribute and value.
|
Avp(Avp avp)
Creates a new Avp copied from the specified Avp.
|
Avp(String name,
Object value)
Creates a new AVP for the specified attribute name and value.
|
Modifier and Type | Method and Description |
---|---|
XmlBuffer |
appendXml(XmlBuffer xb) |
boolean |
equals(Object obj)
Compares this AVP to another object for equality.
|
InetAddress |
getAddress()
Returns the InetAddress value of an Address AVP.
|
Attribute |
getAttribute()
Returns the Attribute for this AVP.
|
AvpList |
getAvpList()
Returns the AvpList value of a Grouped AVP.
|
ByteBuffer |
getBytes()
Returns the ByteBuffer value of an OctetString AVP.
|
int |
getCode()
Returns the AVP code.
|
Date |
getDate()
Returns the Date value of a Time AVP.
|
int |
getInt()
Returns the int value of an Integer32 AVP.
|
long |
getLong()
Returns the long value of an Integer64 AVP.
|
String |
getString()
Returns the String value of a UTF8String AVP.
|
Long |
getUnsigned32()
Returns the long value of an Unsigned32 AVP.
|
BigInteger |
getUnsigned64()
Returns the BigInteger value of an Unsigned64 AVP.
|
Object |
getValue()
Returns the AVP value, which is one of the following Java types depending
on the attribute Diameter type:
|
int |
hashCode()
Returns the hash code for this AVP.
|
boolean |
isGrouped()
Returns true if this is a grouped AVP, false otherwise.
|
boolean |
isValidated() |
boolean |
isVendorSpecific()
Returns true if this AVP is vendor specific, false if it is defined by the
Diameter base protocol (RFC 3588).
|
void |
setValue(Object value) |
String |
toString() |
void |
validate()
Validates an AVP.
|
public Avp(Attribute attr, Object value)
attr
- the Attribute for the AVPvalue
- the value of the AVPIllegalArgumentException
- if the value is inappropriate for the
given attribute typegetValue()
public Avp(String name, Object value)
name
- the attribute namevalue
- the AVP valuepublic Avp(Avp avp)
public void validate() throws AvpException
AvpException
public boolean isValidated()
public Attribute getAttribute()
public int getCode()
public boolean isVendorSpecific()
public boolean isGrouped()
public Object getValue()
Diameter Type Java Type ------------- --------- Signed32 Integer Unsigned32 Long Signed64 Long Unsigned64 BigInteger Address InetAddress OctetString ByteBuffer UTF8String String Time Long Grouped AvpList
public void setValue(Object value)
public int getInt()
public Long getUnsigned32()
Long
value.public long getLong()
public BigInteger getUnsigned64()
BigInteger
valuepublic String getString()
public InetAddress getAddress()
public ByteBuffer getBytes()
public AvpList getAvpList()
public Date getDate()
public int hashCode()
public boolean equals(Object obj)