Class EntryHistoricalAttribute
- All Implemented Interfaces:
Iterable<ByteString>,Collection<ByteString>,Attribute
Attribute implementations that performs lazy conversion of EntryHistorical
(ds-sync-hist) meta-data to its LDAP attribute representation as well as from its compact
org.opends.server.backends.pluggable.ID2Entry representation.
This class optimizes for all conversions except for conversions to and from LDAP Attributes since these are rarely
needed in practice - it is rare for a client application to read the ds-sync-hist attribute or modify it
directly.
-
Constructor Summary
ConstructorsConstructorDescriptionEntryHistoricalAttribute(Supplier<EntryHistorical> delayedEntryHistorical) Creates a new ds-sync-hist attribute whose content will be lazily computed using the provided supplier.EntryHistoricalAttribute(EntryHistorical entryHistorical) Creates a new ds-sync-hist attribute whose content is based on the provided historical information. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds all of the provided attribute values to this attribute if they are not already present (optional operation).booleanadd(ByteString value) Addsvalueto this attribute if it is not already present (optional operation).booleanaddAll(Collection<? extends ByteString> values) Adds all of the attribute values contained invaluesto this attribute if they are not already present (optional operation).<T> booleanaddAll(Collection<T> values, Collection<? super T> duplicateValues) Adds all of the attribute values contained invaluesto this attribute if they are not already present (optional operation).voidclear()Removes all of the attribute values from this attribute (optional operation).booleanReturnstrueif this attribute containsvalue.booleancontainsAll(Collection<?> values) Returnstrueif this attribute contains all of the attribute values contained invalues.booleanReturnstrueifobjectis an attribute which is equal to this attribute.Returns the first attribute value in this attribute.voidforEach(Consumer<? super ByteString> action) voidforEachNormalizedValue(BiConsumer<? super ByteString, ? super ByteString> action) Performs the provided action for each value and its associated normalized value in this attribute.Returns the attribute description of this attribute, which includes its attribute type and any options.Returns the historical information associated with this attribute, computing it if needed.Returns the historical information associated with this attribute, computing it if needed.inthashCode()Returns the hash code for this attribute.booleanisEmpty()Returnstrueif this attribute contains no attribute values.booleanIndicates whether this is a virtual attribute (dynamically computed) rather than a real attribute (persisted).iterator()Returns an iterator over the attribute values in this attribute.booleanmatchesAnyNormalizedValue(Predicate<? super ByteString> predicate) Returnstrueif any values in this attribute match the provided predicate.booleanmatchesAnyNormalizedValue(Map<ByteString, ByteString> normalizedValues) Returnstrueif any values in this attribute match at least one of the values in the provided map.parse()Returns a parser for this attribute which can be used for decoding values as different types of object.booleanRemovesvaluefrom this attribute if it is present (optional operation).booleanremoveAll(Collection<?> values) Removes all of the attribute values contained invaluesfrom this attribute if they are present (optional operation).<T> booleanremoveAll(Collection<T> values, Collection<? super T> missingValues) Removes all of the attribute values contained invaluesfrom this attribute if they are present (optional operation).booleanremoveIf(Predicate<? super ByteString> filter) booleanretainAll(Collection<?> values) Retains only the attribute values in this attribute which are contained invalues(optional operation).<T> booleanretainAll(Collection<T> values, Collection<? super T> missingValues) Retains only the attribute values in this attribute which are contained invalues(optional operation).intsize()Returns the number of attribute values in this attribute.stream()toArray()Returns an array containing all of the attribute values contained in this attribute.<T> T[]toArray(T[] array) Returns an array containing all of the attribute values in this attribute; the runtime type of the returned array is that of the specified array.toString()Returns a string representation of this attribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.forgerock.opendj.ldap.Attribute
firstValueAsString, getAttributeDescriptionAsString, isReal, put, putMethods inherited from interface java.util.Collection
toArray
-
Constructor Details
-
EntryHistoricalAttribute
Creates a new ds-sync-hist attribute whose content will be lazily computed using the provided supplier.- Parameters:
delayedEntryHistorical- The supplier to be invoked in order to compute the attribute's content.
-
EntryHistoricalAttribute
Creates a new ds-sync-hist attribute whose content is based on the provided historical information.- Parameters:
entryHistorical- The historical information from which the attribute values will be computed.
-
-
Method Details
-
getEntryHistoricalForRead
Returns the historical information associated with this attribute, computing it if needed. This method should only be used when the caller does not intend to update the returned historical information.- Parameters:
dn- The name of the entry containing this attribute.- Returns:
- The historical information associated with this attribute, computing it if needed.
-
getEntryHistoricalForUpdate
Returns the historical information associated with this attribute, computing it if needed. This method should be used when the caller intends to update the returned historical information.- Parameters:
dn- The name of the entry containing this attribute.- Returns:
- The historical information associated with this attribute, computing it if needed.
-
getAttributeDescription
Description copied from interface:AttributeReturns the attribute description of this attribute, which includes its attribute type and any options.- Specified by:
getAttributeDescriptionin interfaceAttribute- Returns:
- The attribute description.
-
isVirtual
public boolean isVirtual()Description copied from interface:AttributeIndicates whether this is a virtual attribute (dynamically computed) rather than a real attribute (persisted). -
isEmpty
public boolean isEmpty()Description copied from interface:AttributeReturnstrueif this attribute contains no attribute values.- Specified by:
isEmptyin interfaceAttribute- Specified by:
isEmptyin interfaceCollection<ByteString>- Returns:
trueif this attribute contains no attribute values.
-
add
Description copied from interface:AttributeAddsvalueto this attribute if it is not already present (optional operation). If this attribute already containsvalue, the call leaves the attribute unchanged and returnsfalse.- Specified by:
addin interfaceAttribute- Specified by:
addin interfaceCollection<ByteString>- Parameters:
value- The attribute value to be added to this attribute.- Returns:
trueif this attribute changed as a result of this call.
-
add
Description copied from interface:AttributeAdds all of the provided attribute values to this attribute if they are not already present (optional operation).Any attribute values which are not instances of
ByteStringwill be converted using theByteString.valueOfObject(Object)method. -
addAll
Description copied from interface:AttributeAdds all of the attribute values contained invaluesto this attribute if they are not already present (optional operation).An invocation of this method is equivalent to:
attribute.addAll(values, null);
- Specified by:
addAllin interfaceAttribute- Specified by:
addAllin interfaceCollection<ByteString>- Parameters:
values- The attribute values to be added to this attribute.- Returns:
trueif this attribute changed as a result of this call.
-
addAll
Description copied from interface:AttributeAdds all of the attribute values contained invaluesto this attribute if they are not already present (optional operation). Any attribute values which are already present will be added toduplicateValuesif specified.Any attribute values which are not instances of
ByteStringwill be converted using theByteString.valueOfObject(Object)method.- Specified by:
addAllin interfaceAttribute- Type Parameters:
T- The type of the attribute value objects being added.- Parameters:
values- The attribute values to be added to this attribute.duplicateValues- A collection into which duplicate values will be added, ornullif duplicate values should not be saved.- Returns:
trueif this attribute changed as a result of this call.
-
clear
public void clear()Description copied from interface:AttributeRemoves all of the attribute values from this attribute (optional operation). This attribute will be empty after this call returns.- Specified by:
clearin interfaceAttribute- Specified by:
clearin interfaceCollection<ByteString>
-
contains
Description copied from interface:AttributeReturnstrueif this attribute containsvalue.If
valueis not an instance ofByteStringthen it will be converted using theByteString.valueOfObject(Object)method.- Specified by:
containsin interfaceAttribute- Specified by:
containsin interfaceCollection<ByteString>- Parameters:
value- The attribute value whose presence in this attribute is to be tested.- Returns:
trueif this attribute containsvalue, orfalseif not.
-
containsAll
Description copied from interface:AttributeReturnstrueif this attribute contains all of the attribute values contained invalues.Any attribute values which are not instances of
ByteStringwill be converted using theByteString.valueOfObject(Object)method.- Specified by:
containsAllin interfaceAttribute- Specified by:
containsAllin interfaceCollection<ByteString>- Parameters:
values- The attribute values whose presence in this attribute is to be tested.- Returns:
trueif this attribute contains all of the attribute values contained invalues, orfalseif not.
-
equals
Description copied from interface:AttributeReturnstrueifobjectis an attribute which is equal to this attribute. Two attributes are considered equal if their attribute descriptions are equal, they both have the same number of attribute values, and every attribute value contained in the first attribute is also contained in the second attribute.- Specified by:
equalsin interfaceAttribute- Specified by:
equalsin interfaceCollection<ByteString>- Overrides:
equalsin classObject- Parameters:
object- The object to be tested for equality with this attribute.- Returns:
trueifobjectis an attribute which is equal to this attribute, orfalseif not.
-
firstValue
Description copied from interface:AttributeReturns the first attribute value in this attribute.- Specified by:
firstValuein interfaceAttribute- Returns:
- The first attribute value in this attribute.
-
forEachNormalizedValue
Description copied from interface:AttributePerforms the provided action for each value and its associated normalized value in this attribute.- Specified by:
forEachNormalizedValuein interfaceAttribute- Parameters:
action- The action to perform which will be passed the normalized value as the first parameter and the user provided value as the second parameter.
-
hashCode
public int hashCode()Description copied from interface:AttributeReturns the hash code for this attribute. It will be calculated as the sum of the hash codes of the attribute description and all of the attribute values.- Specified by:
hashCodein interfaceAttribute- Specified by:
hashCodein interfaceCollection<ByteString>- Overrides:
hashCodein classObject- Returns:
- The hash code for this attribute.
-
iterator
Description copied from interface:AttributeReturns an iterator over the attribute values in this attribute. The attribute values are returned in no particular order, unless the implementation of this attribute provides such a guarantee.- Specified by:
iteratorin interfaceAttribute- Specified by:
iteratorin interfaceCollection<ByteString>- Specified by:
iteratorin interfaceIterable<ByteString>- Returns:
- An iterator over the attribute values in this attribute.
-
matchesAnyNormalizedValue
Description copied from interface:AttributeReturnstrueif any values in this attribute match at least one of the values in the provided map. Returnsfalseif this attribute is empty or if the provided map is empty. The map elements are mappings from normalized values to their corresponding values, where the normalized values must have been normalized according to this attribute's equality matching rule.NOTE: this method returns
trueif the intersection of the normalized values in this attribute and the normalized values of the provided map is not empty.- Specified by:
matchesAnyNormalizedValuein interfaceAttribute- Parameters:
normalizedValues- The map whose elements are mappings from normalized values to their corresponding values.- Returns:
trueif any values in this attribute are contained in the provided map.
-
matchesAnyNormalizedValue
Description copied from interface:AttributeReturnstrueif any values in this attribute match the provided predicate. Returnsfalseif this attribute is empty.- Specified by:
matchesAnyNormalizedValuein interfaceAttribute- Parameters:
predicate- The predicate which will be passed the normalized value as the first parameter and the user provided value as the second parameter.- Returns:
trueif any values in this attribute match the provided predicate.
-
parse
Description copied from interface:AttributeReturns a parser for this attribute which can be used for decoding values as different types of object. -
remove
Description copied from interface:AttributeRemovesvaluefrom this attribute if it is present (optional operation). If this attribute does not containvalue, the call leaves the attribute unchanged and returnsfalse.If
valueis not an instance ofByteStringthen it will be converted using theByteString.valueOfObject(Object)method.- Specified by:
removein interfaceAttribute- Specified by:
removein interfaceCollection<ByteString>- Parameters:
value- The attribute value to be removed from this attribute.- Returns:
trueif this attribute changed as a result of this call.
-
removeAll
Description copied from interface:AttributeRemoves all of the attribute values contained invaluesfrom this attribute if they are present (optional operation).Any attribute values which are not instances of
ByteStringwill be converted using theByteString.valueOfObject(Object)method.An invocation of this method is equivalent to:
attribute.removeAll(values, null);
- Specified by:
removeAllin interfaceAttribute- Specified by:
removeAllin interfaceCollection<ByteString>- Parameters:
values- The attribute values to be removed from this attribute.- Returns:
trueif this attribute changed as a result of this call.
-
removeAll
Description copied from interface:AttributeRemoves all of the attribute values contained invaluesfrom this attribute if they are present (optional operation). Any attribute values which are not already present will be added tomissingValuesif specified.Any attribute values which are not instances of
ByteStringwill be converted using theByteString.valueOfObject(Object)method.- Specified by:
removeAllin interfaceAttribute- Type Parameters:
T- The type of the attribute value objects being removed.- Parameters:
values- The attribute values to be removed from this attribute.missingValues- A collection into which missing values will be added, ornullif missing values should not be saved.- Returns:
trueif this attribute changed as a result of this call.
-
retainAll
Description copied from interface:AttributeRetains only the attribute values in this attribute which are contained invalues(optional operation).Any attribute values which are not instances of
ByteStringwill be converted using theByteString.valueOfObject(Object)method.An invocation of this method is equivalent to:
attribute.retainAll(values, null);
- Specified by:
retainAllin interfaceAttribute- Specified by:
retainAllin interfaceCollection<ByteString>- Parameters:
values- The attribute values to be retained in this attribute.- Returns:
trueif this attribute changed as a result of this call.
-
retainAll
Description copied from interface:AttributeRetains only the attribute values in this attribute which are contained invalues(optional operation). Any attribute values which are not already present will be added tomissingValuesif specified.Any attribute values which are not instances of
ByteStringwill be converted using theByteString.valueOfObject(Object)method.- Specified by:
retainAllin interfaceAttribute- Type Parameters:
T- The type of the attribute value objects being retained.- Parameters:
values- The attribute values to be retained in this attribute.missingValues- A collection into which missing values will be added, ornullif missing values should not be saved.- Returns:
trueif this attribute changed as a result of this call.
-
size
public int size()Description copied from interface:AttributeReturns the number of attribute values in this attribute.- Specified by:
sizein interfaceAttribute- Specified by:
sizein interfaceCollection<ByteString>- Returns:
- The number of attribute values in this attribute.
-
toArray
Description copied from interface:AttributeReturns an array containing all of the attribute values contained in this attribute.If this attribute makes any guarantees as to what order its attribute values are returned by its iterator, this method must return the attribute values in the same order.
The returned array will be "safe" in that no references to it are maintained by this attribute. The caller is thus free to modify the returned array.
- Specified by:
toArrayin interfaceAttribute- Specified by:
toArrayin interfaceCollection<ByteString>- Returns:
- An array containing all of the attribute values contained in this attribute.
-
toArray
public <T> T[] toArray(T[] array) Description copied from interface:AttributeReturns an array containing all of the attribute values in this attribute; the runtime type of the returned array is that of the specified array.If the set fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this attribute. If this attribute fits in the specified array with room to spare (i.e., the array has more elements than this attribute), the elements in the array immediately following the end of the set is set to
null.If this attribute makes any guarantees as to what order its attribute values are returned by its iterator, this method must return the attribute values in the same order.
- Specified by:
toArrayin interfaceAttribute- Specified by:
toArrayin interfaceCollection<ByteString>- Type Parameters:
T- The type of elements contained inarray.- Parameters:
array- An array into which the elements of this attribute should be put.- Returns:
- An array containing all of the attribute values contained in this attribute.
-
toString
Description copied from interface:AttributeReturns a string representation of this attribute. -
removeIf
- Specified by:
removeIfin interfaceCollection<ByteString>
-
spliterator
- Specified by:
spliteratorin interfaceCollection<ByteString>- Specified by:
spliteratorin interfaceIterable<ByteString>
-
stream
- Specified by:
streamin interfaceCollection<ByteString>
-
parallelStream
- Specified by:
parallelStreamin interfaceCollection<ByteString>
-
forEach
- Specified by:
forEachin interfaceIterable<ByteString>
-