Package org.opends.server.types
Class VirtualAttribute
- java.lang.Object
-
- org.opends.server.types.AbstractAttribute
-
- org.opends.server.types.VirtualAttribute
-
- All Implemented Interfaces:
Iterable<ByteString>,Attribute
@PublicAPI(stability=VOLATILE, mayInstantiate=false, mayExtend=false, mayInvoke=true) public final class VirtualAttribute extends AbstractAttribute
This class defines a virtual attribute, which is a special kind of attribute whose values do not actually exist in persistent storage but rather are computed or otherwise obtained dynamically.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.opends.server.types.Attribute
Attribute.RemoveOnceSwitchingAttributes
-
-
Constructor Summary
Constructors Constructor Description VirtualAttribute(AttributeType attributeType, Entry entry, VirtualAttributeRule rule)Creates a new virtual attribute with the provided information.
-
Method Summary
All Methods Instance Methods Concrete 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.AttributeDescriptiongetAttributeDescription()Retrieves the attribute description for this attribute.VirtualAttributeRulegetVirtualAttributeRule()Retrieves the virtual attribute rule that governs the behavior of this virtual attribute.ConditionResultgreaterThanOrEqualTo(ByteString assertionValue)Indicates whether this attribute has any value(s) that are greater than or equal to the provided value.booleanisEmpty()Returnstrueif this attribute contains no attribute values.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.voidtoString(StringBuilder buffer)Appends a one-line string representation of this attribute to the provided buffer.-
Methods inherited from class org.opends.server.types.AbstractAttribute
equals, hashCode, isReal, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
VirtualAttribute
public VirtualAttribute(AttributeType attributeType, Entry entry, VirtualAttributeRule rule)
Creates a new virtual attribute with the provided information.- Parameters:
attributeType- The attribute type for this virtual attribute.entry- The entry in which this virtual attribute exists.rule- The virtual attribute rule that governs the behavior of this virtual attribute.
-
-
Method Detail
-
approximatelyEqualTo
public ConditionResult approximatelyEqualTo(ByteString assertionValue)
Description copied from interface:AttributeIndicates 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
public boolean contains(ByteString value)
Description copied from interface:AttributeIndicates 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
public boolean containsAll(Collection<?> values)
Description copied from interface:AttributeIndicates whether this attribute contains all the values in the collection.- Specified by:
containsAllin interfaceAttribute- Overrides:
containsAllin classAbstractAttribute- 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
public ConditionResult matchesEqualityAssertion(ByteString assertionValue)
Description copied from interface:AttributeIndicates 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.
-
getAttributeDescription
public AttributeDescription getAttributeDescription()
Description copied from interface:AttributeRetrieves the attribute description for this attribute.- Returns:
- The attribute description for this attribute.
-
getVirtualAttributeRule
public VirtualAttributeRule getVirtualAttributeRule()
Retrieves the virtual attribute rule that governs the behavior of this virtual attribute.- Returns:
- The virtual attribute rule that governs the behavior of this virtual attribute.
-
greaterThanOrEqualTo
public ConditionResult greaterThanOrEqualTo(ByteString assertionValue)
Description copied from interface:AttributeIndicates 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.
-
isEmpty
public boolean isEmpty()
Description copied from class:AbstractAttributeReturnstrueif this attribute contains no attribute values.This implementation returns
trueif theAttribute.size()of this attribute is zero.- Specified by:
isEmptyin interfaceAttribute- Overrides:
isEmptyin classAbstractAttribute- Returns:
trueif this attribute contains no attribute values.
-
isVirtual
public boolean isVirtual()
Description copied from interface:AttributeIndicates whether this is a virtual attribute (dynamically computed) rather than a real attribute (persisted).- Returns:
trueif this is a virtual attribute.
-
iterator
public Iterator<ByteString> iterator()
Description copied from interface:AttributeReturns 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().- Returns:
- An iterator over the attribute values in this attribute.
-
lessThanOrEqualTo
public ConditionResult lessThanOrEqualTo(ByteString assertionValue)
Description copied from interface:AttributeIndicates 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
public ConditionResult matchesSubstring(ByteString subInitial, List<ByteString> subAny, ByteString subFinal)
Description copied from interface:AttributeIndicates 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
public int size()
Description copied from interface:AttributeReturns the number of attribute values in this attribute.- Returns:
- The number of attribute values in this attribute.
-
toString
public void toString(StringBuilder buffer)
Description copied from interface:AttributeAppends a one-line string representation of this attribute to the provided buffer.- Parameters:
buffer- The buffer to which the information should be appended.
-
-