|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opends.server.types.AbstractAttribute
@PublicAPI(stability=UNCOMMITTED,
mayInstantiate=false,
mayExtend=false,
mayInvoke=true)
public abstract class AbstractAttribute
An abstract base class for implementing new types of
Attribute.
| Constructor Summary | |
|---|---|
protected |
AbstractAttribute()
Creates a new abstract attribute. |
| Method Summary | |
|---|---|
boolean |
containsAll(java.util.Collection<AttributeValue> values)
Indicates whether this attribute contains all the values in the collection. |
boolean |
equals(java.lang.Object o)
Indicates whether the provided object is an attribute that is equal to this attribute. |
java.lang.String |
getName()
Retrieves the user-provided name for this attribute. |
java.lang.String |
getNameWithOptions()
Retrieves the user-provided name of this attribute, along with any options that might have been provided. |
boolean |
hasAllOptions(java.util.Collection<java.lang.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(java.lang.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 |
optionsEqual(java.util.Set<java.lang.String> options)
Indicates whether this attribute has exactly the specified set of options. |
java.lang.String |
toString()
Retrieves a one-line string representation of this attribute. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.opends.server.types.Attribute |
|---|
approximatelyEqualTo, contains, getAttributeType, getOptions, greaterThanOrEqualTo, isVirtual, iterator, lessThanOrEqualTo, matchesSubstring, size, toString |
| Constructor Detail |
|---|
protected AbstractAttribute()
| Method Detail |
|---|
public boolean containsAll(java.util.Collection<AttributeValue> values)
This implementation iterates through each attribute value in the
provided collection, checking to see if this attribute contains
the value using Attribute.contains(AttributeValue).
containsAll in interface Attributevalues - 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(java.lang.Object o)
equals in interface Attributeequals in class java.lang.Objecto - The object for which to make the determination.
true if the provided object is an
attribute that is equal to this attribute, or
false if not.public java.lang.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.
getName in interface Attributepublic java.lang.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 Attributepublic boolean hasAllOptions(java.util.Collection<java.lang.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 Attributeoptions - 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 final int hashCode()
hashCode in interface AttributehashCode in class java.lang.Objectpublic boolean hasOption(java.lang.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).
hasOption in interface Attributeoption - The option for which to make the determination.
true if this attribute has the specified
option, or false if not.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 Attributetrue 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.
isEmpty in interface Attributetrue if this attribute contains no
attribute values.public boolean optionsEqual(java.util.Set<java.lang.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 Attributeoptions - The set of options for which to make the determination
(may be null).
true if this attribute has exactly the
specified set of options.public final java.lang.String toString()
toString in interface AttributetoString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||