public interface AttributeStore extends AttributeRepository
AttributeRepository.AttributeKey<T>| Modifier and Type | Method and Description |
|---|---|
void |
clearAttributes()
Removes all currently stored user-defined attributes
|
default <T> T |
computeAttributeIfAbsent(AttributeRepository.AttributeKey<T> key,
Function<? super AttributeRepository.AttributeKey<T>,? extends T> resolver)
If the specified key is not already associated with a value (or is mapped
to
null), attempts to compute its value using the given mapping
function and enters it into this map unless null. |
<T> T |
removeAttribute(AttributeRepository.AttributeKey<T> key)
Removes the user-defined attribute
|
<T> T |
setAttribute(AttributeRepository.AttributeKey<T> key,
T value)
Sets a user-defined attribute.
|
attributeKeys, getAttribute, getAttributesCount, ofAttributesMap, ofKeyValuePair, resolveAttributedefault <T> T computeAttributeIfAbsent(AttributeRepository.AttributeKey<T> key, Function<? super AttributeRepository.AttributeKey<T>,? extends T> resolver)
null), attempts to compute its value using the given mapping
function and enters it into this map unless null.T - The generic attribute typekey - The key of the attribute; must not be null.resolver - The (never null) mapping function to use if value
not already mapped. If returns null then value is not mapped to
the provided key.null if value not mapped and resolver
did not return a non-null value for it<T> T setAttribute(AttributeRepository.AttributeKey<T> key, T value)
T - The generic attribute typekey - The key of the attribute; must not be null.value - The value of the attribute; must not be null.null if it is new.<T> T removeAttribute(AttributeRepository.AttributeKey<T> key)
T - The generic attribute typekey - The key of the attribute; must not be null.null if no previous valuevoid clearAttributes()
Copyright © 2018–2019 The Apache Software Foundation. All rights reserved.