public abstract class AbstractEntry extends Object implements Entry
Entry
interface,
to minimize the effort required to implement this interface.Modifier | Constructor and Description |
---|---|
protected |
AbstractEntry()
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addAttribute(Attribute attribute)
Ensures that this entry contains the provided attribute and values
(optional operation).
|
Entry |
addAttribute(String attributeDescription,
Object... values)
Ensures that this entry contains the provided attribute and values
(optional operation).
|
boolean |
containsAttribute(Attribute attribute,
Collection<? super ByteString> missingValues)
Returns
true if this entry contains all of the attribute values
contained in attribute . |
boolean |
containsAttribute(String attributeDescription,
Object... values)
Returns
true if this entry contains all of the attribute values
contained in values . |
boolean |
equals(Object object)
Returns
true if object is an entry which is equal to this
entry. |
Iterable<Attribute> |
getAllAttributes(AttributeDescription attributeDescription)
Returns an
Iterable containing all the attributes in this entry
having an attribute description which is a sub-type of the provided
attribute description. |
Iterable<Attribute> |
getAllAttributes(String attributeDescription)
Returns an
Iterable containing all the attributes in this entry
having an attribute description which is a sub-type of the provided
attribute description. |
Attribute |
getAttribute(AttributeDescription attributeDescription)
Returns the named attribute contained in this entry, or
null if
it is not included with this entry. |
Attribute |
getAttribute(String attributeDescription)
Returns the named attribute contained in this entry, or
null if
it is not included with this entry. |
int |
hashCode()
Returns the hash code for this entry.
|
AttributeParser |
parseAttribute(AttributeDescription attributeDescription)
Returns a parser for the named attribute contained in this entry.
|
AttributeParser |
parseAttribute(String attributeDescription)
Returns a parser for the named attribute contained in this entry.
|
boolean |
removeAttribute(Attribute attribute,
Collection<? super ByteString> missingValues)
Removes all of the attribute values contained in
attribute from
this entry if it is present (optional operation). |
boolean |
removeAttribute(AttributeDescription attributeDescription)
Removes the named attribute from this entry if it is present (optional
operation).
|
Entry |
removeAttribute(String attributeDescription,
Object... values)
Removes all of the attribute values contained in
values from the
named attribute in this entry if it is present (optional operation). |
boolean |
replaceAttribute(Attribute attribute)
Adds all of the attribute values contained in
attribute to this
entry, replacing any existing attribute values (optional operation). |
Entry |
replaceAttribute(String attributeDescription,
Object... values)
Adds all of the attribute values contained in
values to this
entry, replacing any existing attribute values (optional operation). |
Entry |
setName(String dn)
Sets the distinguished name of this entry (optional operation).
|
String |
toString()
Returns a string representation of this entry.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAttribute, clearAttributes, getAllAttributes, getAttributeCount, getName, setName
protected AbstractEntry()
public boolean addAttribute(Attribute attribute)
Entry
matching
attribute description, then
this entry will be modified such that it contains attribute
, even
if it is empty.
matching
attribute description, then
the attribute values contained in attribute
will be merged with
the existing attribute values.
NOTE: When attribute
is non-empty, this method implements
LDAP Modify add semantics.
addAttribute
in interface Entry
attribute
- The attribute values to be added to this entry, merging with
any existing attribute values.true
if this entry changed as a result of this call.public Entry addAttribute(String attributeDescription, Object... values)
Entry
matching
attribute description, then
this entry will be modified such that it contains attribute
, even
if it is empty.
matching
attribute description, then
the attribute values contained in attribute
will be merged with
the existing attribute values.
The attribute description will be decoded using the schema associated with this entry (usually the default schema).
Any attribute values which are not instances of ByteString
will
be converted using the ByteString.valueOfObject(Object)
method.
NOTE: When attribute
is non-empty, this method implements
LDAP Modify add semantics.
addAttribute
in interface Entry
attributeDescription
- The name of the attribute whose values are to be added.values
- The attribute values to be added to this entry, merging any
existing attribute values.public boolean containsAttribute(Attribute attribute, Collection<? super ByteString> missingValues)
Entry
true
if this entry contains all of the attribute values
contained in attribute
. If attribute
is empty then this
method will return true
if the attribute is present in this
entry, regardless of how many values it contains.containsAttribute
in interface Entry
attribute
- The attribute values whose presence in this entry is to be
tested.missingValues
- A collection into which missing values will be added, or
null
if missing values should not be saved.true
if this entry contains all of the attribute values
contained in attribute
.public boolean containsAttribute(String attributeDescription, Object... values)
Entry
true
if this entry contains all of the attribute values
contained in values
. If values
is null
or empty
then this method will return true
if the attribute is present in
this entry, regardless of how many values it contains.
The attribute description will be decoded using the schema associated with this entry (usually the default schema).
Any attribute values which are not instances of ByteString
will
be converted using the ByteString.valueOfObject(Object)
method.
containsAttribute
in interface Entry
attributeDescription
- The name of the attribute whose presence in this entry is to
be tested.values
- The attribute values whose presence in this entry is to be
tested, which may be null
.true
if this entry contains all of the attribute values
contained in values
.public boolean equals(Object object)
Entry
true
if object
is an entry which is equal to this
entry. Two entries are considered equal if their distinguished names are
equal, they both have the same number of attributes, and every attribute
contained in the first entry is also contained in the second entry.public Iterable<Attribute> getAllAttributes(AttributeDescription attributeDescription)
Entry
Iterable
containing all the attributes in this entry
having an attribute description which is a sub-type of the provided
attribute description. The returned Iterable
may be used to
remove attributes if permitted by this entry.getAllAttributes
in interface Entry
attributeDescription
- The name of the attributes to be returned.Iterable
containing the matching attributes.public Iterable<Attribute> getAllAttributes(String attributeDescription)
Entry
Iterable
containing all the attributes in this entry
having an attribute description which is a sub-type of the provided
attribute description. The returned Iterable
may be used to
remove attributes if permitted by this entry.
The attribute description will be decoded using the schema associated with this entry (usually the default schema).
getAllAttributes
in interface Entry
attributeDescription
- The name of the attributes to be returned.Iterable
containing the matching attributes.public Attribute getAttribute(AttributeDescription attributeDescription)
Entry
null
if
it is not included with this entry.getAttribute
in interface Entry
attributeDescription
- The name of the attribute to be returned.null
if it is not included with
this entry.public Attribute getAttribute(String attributeDescription)
Entry
null
if
it is not included with this entry.
The attribute description will be decoded using the schema associated with this entry (usually the default schema).
getAttribute
in interface Entry
attributeDescription
- The name of the attribute to be returned.null
if it is not included with
this entry.public int hashCode()
Entry
public AttributeParser parseAttribute(AttributeDescription attributeDescription)
Entry
parseAttribute
in interface Entry
attributeDescription
- The name of the attribute to be parsed.public AttributeParser parseAttribute(String attributeDescription)
Entry
The attribute description will be decoded using the schema associated with this entry (usually the default schema).
parseAttribute
in interface Entry
attributeDescription
- The name of the attribute to be parsed.public boolean removeAttribute(Attribute attribute, Collection<? super ByteString> missingValues)
Entry
attribute
from
this entry if it is present (optional operation). If attribute
is
empty then the entire attribute will be removed if it is present.
NOTE: This method implements LDAP Modify delete semantics.
removeAttribute
in interface Entry
attribute
- The attribute values to be removed from this entry, which may
be empty if the entire attribute is to be removed.missingValues
- A collection into which missing values will be added, or
null
if missing values should not be saved.true
if this entry changed as a result of this call.public boolean removeAttribute(AttributeDescription attributeDescription)
Entry
false
.removeAttribute
in interface Entry
attributeDescription
- The name of the attribute to be removed.true
if this entry changed as a result of this call.public Entry removeAttribute(String attributeDescription, Object... values)
Entry
values
from the
named attribute in this entry if it is present (optional operation). If
values
is null
or empty then the entire attribute will be
removed if it is present.
The attribute description will be decoded using the schema associated with this entry (usually the default schema).
Any attribute values which are not instances of ByteString
will
be converted using the ByteString.valueOfObject(Object)
method.
NOTE: This method implements LDAP Modify delete semantics.
removeAttribute
in interface Entry
attributeDescription
- The name of the attribute whose values are to be removed.values
- The attribute values to be removed from this entry, which may
be null
or empty if the entire attribute is to be
removed.public boolean replaceAttribute(Attribute attribute)
Entry
attribute
to this
entry, replacing any existing attribute values (optional operation). If
attribute
is empty then the entire attribute will be removed if
it is present.
NOTE: This method implements LDAP Modify replace semantics as described in RFC 4511 - Section 4.6. Modify Operation.
replaceAttribute
in interface Entry
attribute
- The attribute values to be added to this entry, replacing any
existing attribute values, and which may be empty if the
entire attribute is to be removed.true
if this entry changed as a result of this call.public Entry replaceAttribute(String attributeDescription, Object... values)
Entry
values
to this
entry, replacing any existing attribute values (optional operation). If
values
is null
or empty then the entire attribute will be
removed if it is present.
The attribute description will be decoded using the schema associated with this entry (usually the default schema).
Any attribute values which are not instances of ByteString
will
be converted using the ByteString.valueOfObject(Object)
method.
NOTE: This method implements LDAP Modify replace semantics as described in RFC 4511 - Section 4.6. Modify Operation.
replaceAttribute
in interface Entry
attributeDescription
- The name of the attribute whose values are to be replaced.values
- The attribute values to be added to this entry, replacing any
existing attribute values, and which may be null
or
empty if the entire attribute is to be removed.public Entry setName(String dn)
Entry
The distinguished name will be decoded using the schema associated with this entry (usually the default schema).
Copyright 2010-2017 ForgeRock AS.