@PublicAPI(stability=UNCOMMITTED, mayInstantiate=false, mayExtend=false, mayInvoke=true) public abstract class AbstractAttribute extends Object implements Attribute
Attribute
.Modifier | Constructor and Description |
---|---|
protected |
AbstractAttribute()
Creates a new abstract attribute.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsAll(Collection<org.forgerock.opendj.ldap.ByteString> values)
Indicates whether this attribute contains all the values in the
collection.
|
boolean |
equals(Object o)
Indicates whether the provided object is an attribute that is
equal to this attribute.
|
String |
getName()
Retrieves the user-provided name for this attribute.
|
String |
getNameWithOptions()
Retrieves the user-provided name of this attribute, along with
any options that might have been provided.
|
boolean |
hasAllOptions(Collection<String> options)
Indicates whether this attribute has all of the options in the
provided collection.
|
int |
hashCode()
Retrieves the hash code for this attribute.
|
boolean |
hasOption(String option)
Indicates whether this attribute has the specified option.
|
boolean |
hasOptions()
Indicates whether this attribute has any options at all.
|
boolean |
isEmpty()
Returns
true if this attribute contains no
attribute values. |
boolean |
isReal()
Indicates whether this is a real attribute (persisted) rather than a virtual attribute
(dynamically computed).
|
boolean |
optionsEqual(Set<String> options)
Indicates whether this attribute has exactly the specified set of
options.
|
String |
toString()
Retrieves a one-line string representation of this attribute.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
approximatelyEqualTo, contains, getAttributeType, getOptions, greaterThanOrEqualTo, isVirtual, iterator, lessThanOrEqualTo, matchesEqualityAssertion, matchesSubstring, size, toString
protected AbstractAttribute()
public boolean containsAll(Collection<org.forgerock.opendj.ldap.ByteString> values)
This implementation iterates through each attribute value in the
provided collection, checking to see if this attribute contains
the value using Attribute.contains(ByteString)
.
containsAll
in interface Attribute
values
- The set of values for which to make the determination.true
if this attribute contains all the
values in the provided collection, or false
if it does not contain at least one of them.public final boolean equals(Object o)
Attribute
public String getName()
This implementation returns the primary name associated with this attribute's attribute type or, if there is no primary name, the attribute type's OID.
public String getNameWithOptions()
This implementation returns this attribute's name if there are no attribute options, otherwise it constructs a string comprising of this attribute's name followed by a semi-colon and a semi-colon separated list of its attribute options.
getNameWithOptions
in interface Attribute
public boolean hasAllOptions(Collection<String> options)
This implementation returns true
if the provided
collection of options is null
or empty. If the
collection is non-empty and this attribute does not have any
options then it returns false
. Otherwise, each
option in the provided collection is checked using
hasOption(String)
and true
is
returned if all the provided options are present.
hasAllOptions
in interface Attribute
options
- The collection of options for which to make the
determination (may be null
).true
if this attribute has all of the
specified options, or false
if it does not
have at least one of them.public int hashCode()
Attribute
public boolean hasOption(String option)
This implementation calls Attribute.getOptions()
to
retrieve this attribute's set of options and then compares them
one at a time against the provided option. All comparisons are
case insensitive (this is why we iterate through the set of
options, rather than doing a simpler set membership test).
public boolean hasOptions()
This implementation retrieves the set of options associated with this attribute and tests to see if it is empty.
hasOptions
in interface Attribute
true
if this attribute has at least one
option, or false
if not.public boolean isEmpty()
true
if this attribute contains no
attribute values.
This implementation returns true
if the
Attribute.size()
of this attribute is zero.
public boolean isReal()
Attribute
public boolean optionsEqual(Set<String> options)
This implementation returns !hasOptions()
if the
provided set of options is null
. Otherwise it
checks that the size of the provided set of options is equal to
the size of this attribute's options, return false
if the sizes differ. If the sizes are the same then each option
in the provided set is checked using
hasOption(String)
and true
is
returned if all the provided options are present.
optionsEqual
in interface Attribute
options
- The set of options for which to make the determination
(may be null
).true
if this attribute has exactly the
specified set of options.Copyright © 2010-2015 ForgeRock AS. All Rights Reserved.