Class BasicAttributes

java.lang.Object
javax.naming.directory.BasicAttributes
All Implemented Interfaces:
Serializable, Cloneable, Attributes

public class BasicAttributes extends Object implements Attributes
This class provides a basic implementation of the Attributes interface.

BasicAttributes is either case-sensitive or case-insensitive (case-ignore). This property is determined at the time the BasicAttributes constructor is called. In a case-insensitive BasicAttributes, the case of its attribute identifiers is ignored when searching for an attribute, or adding attributes. In a case-sensitive BasicAttributes, the case is significant.

When the BasicAttributes class needs to create an Attribute, it uses BasicAttribute. There is no other dependency on BasicAttribute.

Note that updates to BasicAttributes (such as adding or removing an attribute) does not affect the corresponding representation in the directory. Updates to the directory can only be effected using operations in the DirContext interface.

A BasicAttributes instance is not synchronized against concurrent multithreaded access. Multiple threads trying to access and modify a single BasicAttributes instance should lock the object.

Since:
1.3
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new instance of Attributes.
    BasicAttributes(boolean ignoreCase)
    Constructs a new instance of Attributes.
    Constructs a new instance of Attributes with one attribute.
    BasicAttributes(String attrID, Object val, boolean ignoreCase)
    Constructs a new instance of Attributes with one attribute.
  • Method Summary

    Modifier and Type
    Method
    Description
    Makes a copy of the attribute set.
    boolean
    Determines whether this BasicAttributes is equal to another Attributes Two Attributes are equal if they are both instances of Attributes, treat the case of attribute IDs the same way, and contain the same attributes.
    get(String attrID)
    Retrieves the attribute with the given attribute id from the attribute set.
    Retrieves an enumeration of the attributes in the attribute set.
    Retrieves an enumeration of the ids of the attributes in the attribute set.
    int
    Calculates the hash code of this BasicAttributes.
    boolean
    Determines whether the attribute set ignores the case of attribute identifiers when retrieving or adding attributes.
    put(String attrID, Object val)
    Adds a new attribute to the attribute set.
    put(Attribute attr)
    Adds a new attribute to the attribute set.
    remove(String attrID)
    Removes the attribute with the attribute id 'attrID' from the attribute set.
    int
    Retrieves the number of attributes in the attribute set.
    Generates the string representation of this attribute set.

    Methods declared in class java.lang.Object