public class Attributes extends BaseAttributes implements 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.
Attributes 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. 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 IDir interface.
m_impl
Modifier | Constructor and Description |
---|---|
protected |
Attributes(Attributes JNDIattrs)
Hide this constructor
|
|
Attributes(ICS ics)
Constructs a new instance of Attributes.
|
|
Attributes(ICS ics,
boolean ignoreCase)
Constructs a new instance of Attributes.
|
|
Attributes(ICS ics,
String attrID,
Object val)
Constructs a new instance of Attributes with one
attribute.
|
|
Attributes(ICS ics,
String attrID,
Object val,
boolean ignoreCase)
Constructs a new instance of Attributes with one attribute.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Makes a copy of the attribute set.
|
boolean |
equals(Object obj)
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.
|
Attribute |
get(String attrID)
Retrieves the attribute with the given attribute id from the
attribute set.
|
Enumeration |
getAll()
Retrieves an enumeration of the attributes in the attribute
set.
|
Enumeration |
getIDs()
Retrieves enumeration of the ids of the attributes in the
attribute set.
|
int |
hashCode()
Calculates the hash code of this BasicAttributes.
|
boolean |
isCaseIgnored()
Determines whether the attribute set ignores the case of
attribute identifiers when retrieving or adding attributes.
|
Attribute |
put(Attribute attr)
Adds a new attribute to the attribute set.
|
Attribute |
put(String attrID,
Object val)
Adds a new attribute to the attribute set.
|
Attribute |
remove(String attrID)
Removes the attribute with the attribute id 'attrID' from the
attribute set.
|
int |
size()
Retrieves the number of attributes in the attribute set.
|
String |
toString()
Generates the string representation of this attribute set.
|
toJNDIAttributes
protected Attributes(Attributes JNDIattrs)
public Attributes(ICS ics) throws DirectoryException
DirectoryException
public Attributes(ICS ics, String attrID, Object val) throws DirectoryException
attrID
- non-null The id of the attribute to add.val
- The value of the attribute to add. If null, a null
value is added to the attribute.DirectoryException
public Attributes(ICS ics, boolean ignoreCase) throws DirectoryException
ignoreCase
- true means this attribute set will ignore the
case of its attribute identifiers when retrieving or adding
attributes; false means case is respected.DirectoryException
public Attributes(ICS ics, String attrID, Object val, boolean ignoreCase) throws DirectoryException
attrID
- non-null The id of the attribute to add. If this
attribute set ignores the character case of its attribute ids,
the case of attrID is ignored.val
- The value of the attribute to add. If null, a null
value is added to the attribute.ignoreCase
- true means this attribute set will ignore the
case of its attribute identifiers when retrieving or adding
attributes; false means case is respected.DirectoryException
public boolean equals(Object obj)
public Attribute get(String attrID)
public Enumeration getAll()
public Enumeration getIDs()
public int hashCode()
public boolean isCaseIgnored()
public Attribute remove(String attrID)
public int size()