javax.naming.directory
Interface Attributes

All Superinterfaces:
Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable , Serializable sample code for java.io.Serializable definition code for java.io.Serializable
All Known Implementing Classes:
BasicAttributes sample code for javax.naming.directory.BasicAttributes definition code for javax.naming.directory.BasicAttributes

public interface Attributes
extends Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable , Serializable sample code for java.io.Serializable definition code for java.io.Serializable

This interface represents a collection of attributes.

In a directory, named objects can have associated with them attributes. The Attributes interface represents a collection of attributes. For example, you can request from the directory the attributes associated with an object. Those attributes are returned in an object that implements the Attributes interface.

Attributes in an object that implements the Attributes interface are unordered. The object can have zero or more attributes. Attributes is either case-sensitive or case-insensitive (case-ignore). This property is determined at the time the Attributes object is created. (see BasicAttributes constructor for example). In a case-insensitive Attributes, the case of its attribute identifiers is ignored when searching for an attribute, or adding attributes. In a case-sensitive Attributes, the case is significant.

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

Since:
1.3
See Also:
DirContext.getAttributes(javax.naming.Name) sample code for javax.naming.directory.DirContext.getAttributes(javax.naming.Name) definition code for javax.naming.directory.DirContext.getAttributes(javax.naming.Name) , DirContext.modifyAttributes(javax.naming.Name, int, javax.naming.directory.Attributes) sample code for javax.naming.directory.DirContext.modifyAttributes(javax.naming.Name, int, javax.naming.directory.Attributes) definition code for javax.naming.directory.DirContext.modifyAttributes(javax.naming.Name, int, javax.naming.directory.Attributes) , DirContext.bind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes) sample code for javax.naming.directory.DirContext.bind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes) definition code for javax.naming.directory.DirContext.bind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes) , DirContext.rebind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes) sample code for javax.naming.directory.DirContext.rebind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes) definition code for javax.naming.directory.DirContext.rebind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes) , DirContext.createSubcontext(javax.naming.Name, javax.naming.directory.Attributes) sample code for javax.naming.directory.DirContext.createSubcontext(javax.naming.Name, javax.naming.directory.Attributes) definition code for javax.naming.directory.DirContext.createSubcontext(javax.naming.Name, javax.naming.directory.Attributes) , DirContext.search(javax.naming.Name, javax.naming.directory.Attributes, java.lang.String[]) sample code for javax.naming.directory.DirContext.search(javax.naming.Name, javax.naming.directory.Attributes, java.lang.String[]) definition code for javax.naming.directory.DirContext.search(javax.naming.Name, javax.naming.directory.Attributes, java.lang.String[]) , BasicAttributes sample code for javax.naming.directory.BasicAttributes definition code for javax.naming.directory.BasicAttributes

Method Summary
 Object sample code for java.lang.Object definition code for java.lang.Object clone sample code for javax.naming.directory.Attributes.clone() definition code for javax.naming.directory.Attributes.clone() ()
          Makes a copy of the attribute set.
 Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute get sample code for javax.naming.directory.Attributes.get(java.lang.String) definition code for javax.naming.directory.Attributes.get(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  attrID)
          Retrieves the attribute with the given attribute id from the attribute set.
 NamingEnumeration sample code for javax.naming.NamingEnumeration definition code for javax.naming.NamingEnumeration <? extends Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute > getAll sample code for javax.naming.directory.Attributes.getAll() definition code for javax.naming.directory.Attributes.getAll() ()
          Retrieves an enumeration of the attributes in the attribute set.
 NamingEnumeration sample code for javax.naming.NamingEnumeration definition code for javax.naming.NamingEnumeration <String sample code for java.lang.String definition code for java.lang.String > getIDs sample code for javax.naming.directory.Attributes.getIDs() definition code for javax.naming.directory.Attributes.getIDs() ()
          Retrieves an enumeration of the ids of the attributes in the attribute set.
 boolean isCaseIgnored sample code for javax.naming.directory.Attributes.isCaseIgnored() definition code for javax.naming.directory.Attributes.isCaseIgnored() ()
          Determines whether the attribute set ignores the case of attribute identifiers when retrieving or adding attributes.
 Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute put sample code for javax.naming.directory.Attributes.put(javax.naming.directory.Attribute) definition code for javax.naming.directory.Attributes.put(javax.naming.directory.Attribute) (Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute  attr)
          Adds a new attribute to the attribute set.
 Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute put sample code for javax.naming.directory.Attributes.put(java.lang.String, java.lang.Object) definition code for javax.naming.directory.Attributes.put(java.lang.String, java.lang.Object) (String sample code for java.lang.String definition code for java.lang.String  attrID, Object sample code for java.lang.Object definition code for java.lang.Object  val)
          Adds a new attribute to the attribute set.
 Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute remove sample code for javax.naming.directory.Attributes.remove(java.lang.String) definition code for javax.naming.directory.Attributes.remove(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  attrID)
          Removes the attribute with the attribute id 'attrID' from the attribute set.
 int size sample code for javax.naming.directory.Attributes.size() definition code for javax.naming.directory.Attributes.size() ()
          Retrieves the number of attributes in the attribute set.
 

Method Detail

isCaseIgnored sample code for javax.naming.directory.Attributes.isCaseIgnored() definition code for javax.naming.directory.Attributes.isCaseIgnored()

boolean isCaseIgnored()
Determines whether the attribute set ignores the case of attribute identifiers when retrieving or adding attributes.

Returns:
true if case is ignored; false otherwise.

size sample code for javax.naming.directory.Attributes.size() definition code for javax.naming.directory.Attributes.size()

int size()
Retrieves the number of attributes in the attribute set.

Returns:
The nonnegative number of attributes in this attribute set.

get sample code for javax.naming.directory.Attributes.get(java.lang.String) definition code for javax.naming.directory.Attributes.get(java.lang.String)

Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute  get(String sample code for java.lang.String definition code for java.lang.String  attrID)
Retrieves the attribute with the given attribute id from the attribute set.

Parameters:
attrID - The non-null id of the attribute to retrieve. If this attribute set ignores the character case of its attribute ids, the case of attrID is ignored.
Returns:
The attribute identified by attrID; null if not found.
See Also:
put(java.lang.String, java.lang.Object) sample code for javax.naming.directory.Attributes.put(java.lang.String, java.lang.Object) definition code for javax.naming.directory.Attributes.put(java.lang.String, java.lang.Object) , remove(java.lang.String) sample code for javax.naming.directory.Attributes.remove(java.lang.String) definition code for javax.naming.directory.Attributes.remove(java.lang.String)

getAll sample code for javax.naming.directory.Attributes.getAll() definition code for javax.naming.directory.Attributes.getAll()

NamingEnumeration sample code for javax.naming.NamingEnumeration definition code for javax.naming.NamingEnumeration <? extends Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute > getAll()
Retrieves an enumeration of the attributes in the attribute set. The effects of updates to this attribute set on this enumeration are undefined.

Returns:
A non-null enumeration of the attributes in this attribute set. Each element of the enumeration is of class Attribute. If attribute set has zero attributes, an empty enumeration is returned.

getIDs sample code for javax.naming.directory.Attributes.getIDs() definition code for javax.naming.directory.Attributes.getIDs()

NamingEnumeration sample code for javax.naming.NamingEnumeration definition code for javax.naming.NamingEnumeration <String sample code for java.lang.String definition code for java.lang.String > getIDs()
Retrieves an enumeration of the ids of the attributes in the attribute set. The effects of updates to this attribute set on this enumeration are undefined.

Returns:
A non-null enumeration of the attributes' ids in this attribute set. Each element of the enumeration is of class String. If attribute set has zero attributes, an empty enumeration is returned.

put sample code for javax.naming.directory.Attributes.put(java.lang.String, java.lang.Object) definition code for javax.naming.directory.Attributes.put(java.lang.String, java.lang.Object)

Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute  put(String sample code for java.lang.String definition code for java.lang.String  attrID,
              Object sample code for java.lang.Object definition code for java.lang.Object  val)
Adds a new attribute to the attribute set.

Parameters:
attrID - non-null The id of the attribute to add. If the attribute set ignores the character case of its attribute ids, the case of attrID is ignored.
val - The possibly null value of the attribute to add. If null, the attribute does not have any values.
Returns:
The Attribute with attrID that was previous in this attribute set; null if no such attribute existed.
See Also:
remove(java.lang.String) sample code for javax.naming.directory.Attributes.remove(java.lang.String) definition code for javax.naming.directory.Attributes.remove(java.lang.String)

put sample code for javax.naming.directory.Attributes.put(javax.naming.directory.Attribute) definition code for javax.naming.directory.Attributes.put(javax.naming.directory.Attribute)

Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute  put(Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute  attr)
Adds a new attribute to the attribute set.

Parameters:
attr - The non-null attribute to add. If the attribute set ignores the character case of its attribute ids, the case of attr's identifier is ignored.
Returns:
The Attribute with the same ID as attr that was previous in this attribute set; null if no such attribute existed.
See Also:
remove(java.lang.String) sample code for javax.naming.directory.Attributes.remove(java.lang.String) definition code for javax.naming.directory.Attributes.remove(java.lang.String)

remove sample code for javax.naming.directory.Attributes.remove(java.lang.String) definition code for javax.naming.directory.Attributes.remove(java.lang.String)

Attribute sample code for javax.naming.directory.Attribute definition code for javax.naming.directory.Attribute  remove(String sample code for java.lang.String definition code for java.lang.String  attrID)
Removes the attribute with the attribute id 'attrID' from the attribute set. If the attribute does not exist, ignore.

Parameters:
attrID - The non-null id of the attribute to remove. If the attribute set ignores the character case of its attribute ids, the case of attrID is ignored.
Returns:
The Attribute with the same ID as attrID that was previous in the attribute set; null if no such attribute existed.

clone sample code for javax.naming.directory.Attributes.clone() definition code for javax.naming.directory.Attributes.clone()

Object sample code for java.lang.Object definition code for java.lang.Object  clone()
Makes a copy of the attribute set. The new set contains the same attributes as the original set: the attributes are not themselves cloned. Changes to the copy will not affect the original and vice versa.

Returns:
A non-null copy of this attribute set.