Cloneable
, Serializable
BasicAttributes
public interface Attributes extends Cloneable, Serializable
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.
Modifier and Type | Method | Description |
---|---|---|
Object |
clone() |
Makes a copy of the attribute set. |
Attribute |
get |
Retrieves the attribute with the given attribute id from the attribute set. |
NamingEnumeration |
getAll() |
Retrieves an enumeration of the attributes in the attribute set. |
NamingEnumeration |
getIDs() |
Retrieves an enumeration of the ids of the attributes in the attribute set. |
boolean |
isCaseIgnored() |
Determines whether the attribute set ignores the case of attribute identifiers when retrieving or adding attributes. |
Attribute |
put |
Adds a new attribute to the attribute set. |
Attribute |
put |
Adds a new attribute to the attribute set. |
Attribute |
remove |
Removes the attribute with the attribute id 'attrID' from the attribute set. |
int |
size() |
Retrieves the number of attributes in the attribute set. |
boolean isCaseIgnored()
int size()
Attribute get(String attrID)
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.NamingEnumeration<? extends Attribute> getAll()
Attribute
. If attribute set has zero attributes, an empty enumeration is returned.NamingEnumeration<String> getIDs()
Attribute put(String attrID, Object val)
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.Attribute put(Attribute attr)
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.Attribute remove(String attrID)
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.Object clone()
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.naming/javax/naming/directory/Attributes.html