Class AttributeType



  • public class AttributeType
    extends java.lang.Object
    Represents a Radius attribute type.
    • Constructor Detail

      • AttributeType

        public AttributeType​(int attributeType,
                             java.lang.String name,
                             java.lang.String typeStr)
        Create a new attribute type.
        Parameters:
        attributeType - Radius attribute type code
        name - Attribute type name
        typeStr - string|octets|integer|date|ipaddr|ipv6addr|ipv6prefix
      • AttributeType

        public AttributeType​(int vendorId,
                             int attributeType,
                             java.lang.String name,
                             java.lang.String rawDataType)
        Constructs a Vendor-Specific sub-attribute type.
        Parameters:
        vendorId - vendor ID
        attributeType - sub-attribute type code
        name - sub-attribute name
        rawDataType - string|octets|integer|date|ipaddr|ipv6addr|ipv6prefix
    • Method Detail

      • getTypeCode

        public int getTypeCode​()
        Returns:
        Radius type code for this attribute e.g. '1' (for User-Name)
      • getName

        public java.lang.String getName​()
        Returns:
        name of type e.g. 'User-Name'
      • getVendorId

        public int getVendorId​()
        Returns:
        vendor ID or -1 if not applicable
      • getDataType

        public java.lang.String getDataType​()
      • getEnumeration

        public java.lang.String getEnumeration​(int value)
        Parameters:
        value - int value
        Returns:
        the name of the given integer value if this attribute is an enumeration, or null if it is not or if the integer value is unknown.
      • getEnumeration

        public java.lang.Integer getEnumeration​(java.lang.String value)
        Parameters:
        value - string value
        Returns:
        the number of the given string value if this attribute is an enumeration, or null if it is not or if the string value is unknown.
      • addEnumerationValue

        public void addEnumerationValue​(int num,
                                        java.lang.String name)
        Adds a name for an integer value of this attribute.
        Parameters:
        num - number that shall get a name
        name - the name for this number
      • toString

        public java.lang.String toString​()
        Overrides:
        toString in class java.lang.Object