public interface AttributeRepository
Modifier and Type | Interface and Description |
---|---|
static class |
AttributeRepository.AttributeKey<T>
Type safe key for storage of user attributes.
|
Modifier and Type | Method and Description |
---|---|
Collection<AttributeRepository.AttributeKey<?>> |
attributeKeys() |
<T> T |
getAttribute(AttributeRepository.AttributeKey<T> key)
Returns the value of the user-defined attribute.
|
int |
getAttributesCount() |
static AttributeRepository |
ofAttributesMap(Map<AttributeRepository.AttributeKey<?>,?> attributes) |
static <A> AttributeRepository |
ofKeyValuePair(AttributeRepository.AttributeKey<A> key,
A value) |
default <T> T |
resolveAttribute(AttributeRepository.AttributeKey<T> key)
Attempts to resolve the associated value by going up the store's
hierarchy (if any)
|
int getAttributesCount()
<T> T getAttribute(AttributeRepository.AttributeKey<T> key)
T
- The generic attribute typekey
- The key of the attribute; must not be null
.null
if there is no value associated with the specified keydefault <T> T resolveAttribute(AttributeRepository.AttributeKey<T> key)
T
- The generic attribute typekey
- The key of the attribute; must not be null
.null
if there is no value associated with the specified key
either in this repository or any of its ancestors (if any available)Collection<AttributeRepository.AttributeKey<?>> attributeKeys()
Collection
snapshot of all the currently registered
attributes in the repositorystatic <A> AttributeRepository ofKeyValuePair(AttributeRepository.AttributeKey<A> key, A value)
static AttributeRepository ofAttributesMap(Map<AttributeRepository.AttributeKey<?>,?> attributes)
Copyright © 2008–2022 The Apache Software Foundation. All rights reserved.