@API(status=INTERNAL,
since="5.0")
public class ExtensionValuesStore
extends java.lang.Object
ExtensionValuesStore
is used inside implementations of
ExtensionContext
to store and retrieve values.Modifier and Type | Class and Description |
---|---|
private static class |
ExtensionValuesStore.CompositeKey |
private static class |
ExtensionValuesStore.MemoizingSupplier |
Modifier and Type | Field and Description |
---|---|
private ExtensionValuesStore |
parentStore |
private java.util.concurrent.ConcurrentMap<ExtensionValuesStore.CompositeKey,java.util.function.Supplier<java.lang.Object>> |
storedValues |
Constructor and Description |
---|
ExtensionValuesStore(ExtensionValuesStore parentStore) |
Modifier and Type | Method and Description |
---|---|
private <T> T |
castToRequiredType(java.lang.Object key,
java.lang.Object value,
java.lang.Class<T> requiredType) |
(package private) java.lang.Object |
get(ExtensionContext.Namespace namespace,
java.lang.Object key) |
(package private) <T> T |
get(ExtensionContext.Namespace namespace,
java.lang.Object key,
java.lang.Class<T> requiredType) |
(package private) <K,V> java.lang.Object |
getOrComputeIfAbsent(ExtensionContext.Namespace namespace,
K key,
java.util.function.Function<K,V> defaultCreator) |
(package private) <K,V> V |
getOrComputeIfAbsent(ExtensionContext.Namespace namespace,
K key,
java.util.function.Function<K,V> defaultCreator,
java.lang.Class<V> requiredType) |
private java.util.function.Supplier<java.lang.Object> |
getStoredValue(ExtensionValuesStore.CompositeKey compositeKey) |
(package private) void |
put(ExtensionContext.Namespace namespace,
java.lang.Object key,
java.lang.Object value) |
(package private) java.lang.Object |
remove(ExtensionContext.Namespace namespace,
java.lang.Object key) |
(package private) <T> T |
remove(ExtensionContext.Namespace namespace,
java.lang.Object key,
java.lang.Class<T> requiredType) |
private final ExtensionValuesStore parentStore
private final java.util.concurrent.ConcurrentMap<ExtensionValuesStore.CompositeKey,java.util.function.Supplier<java.lang.Object>> storedValues
public ExtensionValuesStore(ExtensionValuesStore parentStore)
java.lang.Object get(ExtensionContext.Namespace namespace, java.lang.Object key)
<T> T get(ExtensionContext.Namespace namespace, java.lang.Object key, java.lang.Class<T> requiredType)
<K,V> java.lang.Object getOrComputeIfAbsent(ExtensionContext.Namespace namespace, K key, java.util.function.Function<K,V> defaultCreator)
<K,V> V getOrComputeIfAbsent(ExtensionContext.Namespace namespace, K key, java.util.function.Function<K,V> defaultCreator, java.lang.Class<V> requiredType)
void put(ExtensionContext.Namespace namespace, java.lang.Object key, java.lang.Object value)
java.lang.Object remove(ExtensionContext.Namespace namespace, java.lang.Object key)
<T> T remove(ExtensionContext.Namespace namespace, java.lang.Object key, java.lang.Class<T> requiredType)
private java.util.function.Supplier<java.lang.Object> getStoredValue(ExtensionValuesStore.CompositeKey compositeKey)
private <T> T castToRequiredType(java.lang.Object key, java.lang.Object value, java.lang.Class<T> requiredType)