Package org.tinyradius.attribute
Class RadiusAttribute
- java.lang.Object
-
- org.tinyradius.attribute.RadiusAttribute
-
- Direct Known Subclasses:
IntegerAttribute
,IpAttribute
,Ipv6PrefixAttribute
,StringAttribute
,VendorSpecificAttribute
public class RadiusAttribute extends java.lang.Object
This class represents a generic Radius attribute. Subclasses implement methods to access the fields of special attributes.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.lang.String
getAttributeKey()
AttributeType
getAttributeType()
Dictionary
getDictionary()
int
getType()
byte[]
getValue()
java.lang.String
getValueString()
int
getVendorId()
int
hashCode()
java.util.Map<java.lang.String,java.lang.String>
toAttributeMap()
Returns set of entry of Attribute name and Value as string.byte[]
toByteArray()
java.lang.String
toString()
-
-
-
Method Detail
-
getValue
public byte[] getValue()
- Returns:
- attribute data as raw bytes
-
getType
public int getType()
- Returns:
- attribute type code, 0-255
-
getValueString
public java.lang.String getValueString()
- Returns:
- value of this attribute as a hex string.
-
getVendorId
public int getVendorId()
- Returns:
- vendor Id if Vendor-Specific attribute or sub-attribute, otherwise -1
-
getDictionary
public Dictionary getDictionary()
- Returns:
- dictionary that attribute uses
-
toByteArray
public byte[] toByteArray()
- Returns:
- entire attribute (including headers) as byte array
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getAttributeKey
public java.lang.String getAttributeKey()
-
toAttributeMap
public java.util.Map<java.lang.String,java.lang.String> toAttributeMap()
Returns set of entry of Attribute name and Value as string. Size is generally 1, except in case of VendorSpecificAttribute where it is aggregate of sub-attributes.- Returns:
- Set of String/String Entry
-
getAttributeType
public AttributeType getAttributeType()
- Returns:
- AttributeType object for (sub-)attribute or null
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-