Package org.opends.server.types
Interface Attribute
-
- All Superinterfaces:
Iterable<ByteString>
- All Known Implementing Classes:
AbstractAttribute,CollectiveVirtualAttribute,VirtualAttribute
@PublicAPI(stability=UNCOMMITTED, mayInstantiate=false, mayExtend=false, mayInvoke=true) public interface Attribute extends Iterable<ByteString>
This class defines a data structure for storing and interacting with an attribute that may be used in the Directory Server.Attributes are immutable and therefore any attempts to modify them will result in an
UnsupportedOperationException.There are two types of attribute: real attributes and virtual attributes. Real attributes can be created using the
AttributeBuilderclass or by using the various static factory methods in theAttributesclass, whereas virtual attributes are represented using theVirtualAttributeclass. New attribute implementations can be implemented by either implementing this interface or by extendingAbstractAttribute.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceAttribute.RemoveOnceSwitchingAttributesMarks code that can be removed once we are switching from server's to SDK'sAttribute.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ConditionResultapproximatelyEqualTo(ByteString assertionValue)Indicates whether this attribute has any value(s) that are approximately equal to the provided value.booleancontains(ByteString value)Indicates whether this attribute contains the specified value.booleancontainsAll(Collection<?> values)Indicates whether this attribute contains all the values in the collection.booleanequals(Object o)Indicates whether the provided object is an attribute that is equal to this attribute.AttributeDescriptiongetAttributeDescription()Retrieves the attribute description for this attribute.ConditionResultgreaterThanOrEqualTo(ByteString assertionValue)Indicates whether this attribute has any value(s) that are greater than or equal to the provided value.inthashCode()Retrieves the hash code for this attribute.booleanisEmpty()Returnstrueif this attribute contains no attribute values.booleanisReal()Indicates whether this is a real attribute (persisted) rather than a virtual attribute (dynamically computed).booleanisVirtual()Indicates whether this is a virtual attribute (dynamically computed) rather than a real attribute (persisted).Iterator<ByteString>iterator()Returns an iterator over the attribute values in this attribute.ConditionResultlessThanOrEqualTo(ByteString assertionValue)Indicates whether this attribute has any value(s) that are less than or equal to the provided value.ConditionResultmatchesEqualityAssertion(ByteString assertionValue)Indicates whether this attribute matches the specified assertion value.ConditionResultmatchesSubstring(ByteString subInitial, List<ByteString> subAny, ByteString subFinal)Indicates whether this attribute has any value(s) that match the provided substring.intsize()Returns the number of attribute values in this attribute.StringtoString()Retrieves a one-line string representation of this attribute.voidtoString(StringBuilder buffer)Appends a one-line string representation of this attribute to the provided buffer.-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
approximatelyEqualTo
ConditionResult approximatelyEqualTo(ByteString assertionValue)
Indicates whether this attribute has any value(s) that are approximately equal to the provided value.- Parameters:
assertionValue- The assertion value for which to make the determination.- Returns:
ConditionResult.UNDEFINEDif this attribute does not have an approximate matching rule,ConditionResult.TRUEif at least one value is approximately equal to the provided value, orConditionResult.FALSEotherwise.
-
contains
boolean contains(ByteString value)
Indicates whether this attribute contains the specified value.- Parameters:
value- The value for which to make the determination.- Returns:
trueif this attribute has the specified value, orfalseif not.
-
containsAll
boolean containsAll(Collection<?> values)
Indicates whether this attribute contains all the values in the collection.- Parameters:
values- The set of values for which to make the determination.- Returns:
trueif this attribute contains all the values in the provided collection, orfalseif it does not contain at least one of them.
-
matchesEqualityAssertion
ConditionResult matchesEqualityAssertion(ByteString assertionValue)
Indicates whether this attribute matches the specified assertion value.- Parameters:
assertionValue- The assertion value for which to make the determination.- Returns:
trueif this attribute matches the specified assertion value, orfalseif not.
-
equals
boolean equals(Object o)
Indicates whether the provided object is an attribute that is equal to this attribute. It will be considered equal if the attribute type, set of values, and set of options are equal.
-
getAttributeDescription
AttributeDescription getAttributeDescription()
Retrieves the attribute description for this attribute.- Returns:
- The attribute description for this attribute.
-
greaterThanOrEqualTo
ConditionResult greaterThanOrEqualTo(ByteString assertionValue)
Indicates whether this attribute has any value(s) that are greater than or equal to the provided value.- Parameters:
assertionValue- The assertion value for which to make the determination.- Returns:
ConditionResult.UNDEFINEDif this attribute does not have an ordering matching rule,ConditionResult.TRUEif at least one value is greater than or equal to the provided assertion value, orConditionResult.FALSEotherwise.
-
hashCode
int hashCode()
Retrieves the hash code for this attribute. It will be calculated as the sum of the hash code for the attribute type and all values.
-
isEmpty
boolean isEmpty()
Returnstrueif this attribute contains no attribute values.- Returns:
trueif this attribute contains no attribute values.
-
isReal
boolean isReal()
Indicates whether this is a real attribute (persisted) rather than a virtual attribute (dynamically computed).- Returns:
trueif this is a real attribute.
-
isVirtual
boolean isVirtual()
Indicates whether this is a virtual attribute (dynamically computed) rather than a real attribute (persisted).- Returns:
trueif this is a virtual attribute.
-
iterator
Iterator<ByteString> iterator()
Returns an iterator over the attribute values in this attribute. The attribute values are returned in the order in which they were added this attribute. The returned iterator does not support attribute value removals viaIterator.remove().- Specified by:
iteratorin interfaceIterable<ByteString>- Returns:
- An iterator over the attribute values in this attribute.
-
lessThanOrEqualTo
ConditionResult lessThanOrEqualTo(ByteString assertionValue)
Indicates whether this attribute has any value(s) that are less than or equal to the provided value.- Parameters:
assertionValue- The assertion value for which to make the determination.- Returns:
ConditionResult.UNDEFINEDif this attribute does not have an ordering matching rule,ConditionResult.TRUEif at least one value is less than or equal to the provided assertion value, orConditionResult.FALSEotherwise.
-
matchesSubstring
ConditionResult matchesSubstring(ByteString subInitial, List<ByteString> subAny, ByteString subFinal)
Indicates whether this attribute has any value(s) that match the provided substring.- Parameters:
subInitial- The subInitial component to use in the determination.subAny- The subAny components to use in the determination.subFinal- The subFinal component to use in the determination.- Returns:
ConditionResult.UNDEFINEDif this attribute does not have a substring matching rule,ConditionResult.TRUEif at least one value matches the provided substring, orConditionResult.FALSEotherwise.
-
size
int size()
Returns the number of attribute values in this attribute.- Returns:
- The number of attribute values in this attribute.
-
toString
String toString()
Retrieves a one-line string representation of this attribute.
-
toString
void toString(StringBuilder buffer)
Appends a one-line string representation of this attribute to the provided buffer.- Parameters:
buffer- The buffer to which the information should be appended.
-
-