src/main/java/org/tinyradius/packet/RadiusPacket.java
public void addAttribute(String typeName, String value) {
        if (typeName == null || typeName.length() == 0) {
            throw new IllegalArgumentException("type name is empty");
        }
        if (value == null || value.length() == 0) {
            throw new IllegalArgumentException("value is empty");
        }

        AttributeType type = dictionary.getAttributeTypeByName(typeName);
        if (type == null) {
            throw new IllegalArgumentException("unknown attribute type '" + typeName + "'");
        }

        RadiusAttribute attribute = RadiusAttribute.createRadiusAttribute(getDictionary(), type.getVendorId(), type.getTypeCode());
        attribute.setAttributeValue(value);
        addAttribute(attribute);
    }
/**
     * Adds a Radius attribute to this packet.
     * Uses AttributeTypes to lookup the type code and converts
     * the value.
     * Can also be used to add sub-attributes.
     *
     * @param typeName name of the attribute, for example "NAS-Ip-Address"
     * @param value    value of the attribute, for example "127.0.0.1"
     * @throws IllegalArgumentException if type name is unknown
     */
Adds a Radius attribute to this packet.
Uses AttributeTypes to lookup the type code and converts
the value.
Can also be used to add sub-attributes.

@param typeName name of the attribute, for example "NAS-Ip-Address"
@param value    value of the attribute, for example "127.0.0.1"
@throws IllegalArgumentException if type name is unknown
Adds a Radius attribute to this packet . Uses AttributeTypes to lookup the type code and converts the value . Can also be used to add sub - attributes . @param typeName name of the attribute for example " NAS - Ip - Address " @param value value of the attribute for example " 127 . 0 . 0 . 1 " @throws IllegalArgumentException if type name is unknown
public void addAttribute(String typeName, String value) {
        if (typeName == null || typeName.length() == 0) {
            throw new IllegalArgumentException("type name is empty");
        }
        if (value == null || value.length() == 0) {
            throw new IllegalArgumentException("value is empty");
        }
        AttributeType type = dictionary.getAttributeTypeByName(typeName);
        if (type == null) {
            throw new IllegalArgumentException("unknown attribute type '" + typeName + "'");
        }
        RadiusAttribute attribute = RadiusAttribute.createRadiusAttribute(getDictionary(), type.getVendorId(), type.getTypeCode());
        attribute.setAttributeValue(value);
        addAttribute(attribute);
    }
public void addAttribute ( String typeName , String value ) { if ( typeName == null || typeName . length ( ) == 0 ) { throw new IllegalArgumentException ( "type name is empty" ) ; } if ( value == null || value . length ( ) == 0 ) { throw new IllegalArgumentException ( "value is empty" ) ; } AttributeType type = dictionary . getAttributeTypeByName ( typeName ) ; if ( type == null ) { throw new IllegalArgumentException ( "unknown attribute type '" + typeName + "'" ) ; } RadiusAttribute attribute = RadiusAttribute . createRadiusAttribute ( getDictionary ( ) , type . getVendorId ( ) , type . getTypeCode ( ) ) ; attribute . setAttributeValue ( value ) ; addAttribute ( attribute ) ; }
Adds a Radius attribute to this packet.
Adds a Radius attribute to this packet .