Top Fields Constructors Methods
org.junit.jupiter.engine.execution

public Class NamespaceAwareStore

extends Object
implements Store
Class Inheritance
All Implemented Interfaces
org.junit.jupiter.api.extension.ExtensionContext.Store
Annotations
@API
status:INTERNAL
since:5.0
Static Imports
org.apiguardian.api.API.Status.INTERNAL

Since
5.0

Field Summary

Modifier and TypeField and Description
private final Namespace
private final NamespacedHierarchicalStore<Namespace>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private <T extends @Nullable Object> T
accessStore(Supplier<T> action)

public <K, V> Object
computeIfAbsent(K key, Function<? super K, ? extends V> defaultCreator)

Implements org.junit.jupiter.api.extension.ExtensionContext.Store.computeIfAbsent.

Return the value of the specified required type that is stored under the supplied key.

public <K, V> V
computeIfAbsent(K key, Function<? super K, ? extends V> defaultCreator, Class<V> requiredType)

Implements org.junit.jupiter.api.extension.ExtensionContext.Store.computeIfAbsent.

Get the value of the specified required type that is stored under the supplied key.

public @Nullable Object
get(Object key)

Implements org.junit.jupiter.api.extension.ExtensionContext.Store.get.

Get the value that is stored under the supplied key.

public <T> @Nullable T
get(Object key, Class<T> requiredType)

Implements org.junit.jupiter.api.extension.ExtensionContext.Store.get.

Get the value of the specified required type that is stored under the supplied key.

public <K, V extends @Nullable Object> @Nullable Object
getOrComputeIfAbsent(K key, Function<? super K, ? extends V> defaultCreator)

Implements org.junit.jupiter.api.extension.ExtensionContext.Store.getOrComputeIfAbsent.

Get the value that is stored under the supplied key.

public <K, V extends @Nullable Object> @Nullable V
getOrComputeIfAbsent(K key, Function<? super K, ? extends V> defaultCreator, Class<V> requiredType)

Implements org.junit.jupiter.api.extension.ExtensionContext.Store.getOrComputeIfAbsent.

Get the value of the specified required type that is stored under the supplied key.

public void
put(Object key, @Nullable Object value)

public @Nullable Object
remove(Object key)

Implements org.junit.jupiter.api.extension.ExtensionContext.Store.remove.

Remove the value that was previously stored under the supplied key.

public <T> @Nullable T
remove(Object key, Class<T> requiredType)

Implements org.junit.jupiter.api.extension.ExtensionContext.Store.remove.

Remove the value of the specified required type that was previously stored under the supplied key.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

namespaceback to summary
private final Namespace namespace
valuesStoreback to summary
private final NamespacedHierarchicalStore<Namespace> valuesStore

Constructor Detail

NamespaceAwareStoreback to summary
public NamespaceAwareStore(NamespacedHierarchicalStore<Namespace> valuesStore, Namespace namespace)

Method Detail

accessStoreback to summary
private <T extends @Nullable Object> T accessStore(Supplier<T> action)
computeIfAbsentback to summary
public <K, V> Object computeIfAbsent(K key, Function<? super K, ? extends V> defaultCreator)

Implements org.junit.jupiter.api.extension.ExtensionContext.Store.computeIfAbsent.

Doc from org.junit.jupiter.api.extension.ExtensionContext.Store.computeIfAbsent.

Return the value of the specified required type that is stored under the supplied key.

If no value is stored in the current ExtensionContext for the supplied key, ancestors of the context will be queried for a value with the same key in the Namespace used to create this store. If no value is found for the supplied key or the value is null, a new value will be computed by the defaultCreator (given the key as input), stored, and returned.

For greater type safety, consider using computeIfAbsent(Object, Function, Class) instead.

If the created value is an instance of CloseableResource or AutoCloseable (unless the junit.jupiter.extensions.store.close.autocloseable.enabled configuration parameter is set to false), then the close() method will be invoked on the stored object when the store is closed.

Annotations
@Override
computeIfAbsentback to summary
public <K, V> V computeIfAbsent(K key, Function<? super K, ? extends V> defaultCreator, Class<V> requiredType)

Implements org.junit.jupiter.api.extension.ExtensionContext.Store.computeIfAbsent.

Doc from org.junit.jupiter.api.extension.ExtensionContext.Store.computeIfAbsent.

Get the value of the specified required type that is stored under the supplied key.

If no value is stored in the current ExtensionContext for the supplied key, ancestors of the context will be queried for a value with the same key in the Namespace used to create this store. If no value is found for the supplied key or the value is null, a new value will be computed by the defaultCreator (given the key as input), stored, and returned.

If the created value is an instance of CloseableResource or AutoCloseable (unless the junit.jupiter.extensions.store.close.autocloseable.enabled configuration parameter is set to false), then the close() method will be invoked on the stored object when the store is closed.

Annotations
@Override
getback to summary
public @Nullable Object get(Object key)

Implements org.junit.jupiter.api.extension.ExtensionContext.Store.get.

Doc from org.junit.jupiter.api.extension.ExtensionContext.Store.get.

Get the value that is stored under the supplied key.

If no value is stored in the current ExtensionContext for the supplied key, ancestors of the context will be queried for a value with the same key in the Namespace used to create this store.

For greater type safety, consider using get(Object, Class) instead.

Annotations
@Override
getback to summary
public <T> @Nullable T get(Object key, Class<T> requiredType)

Implements org.junit.jupiter.api.extension.ExtensionContext.Store.get.

Doc from org.junit.jupiter.api.extension.ExtensionContext.Store.get.

Get the value of the specified required type that is stored under the supplied key.

If no value is stored in the current ExtensionContext for the supplied key, ancestors of the context will be queried for a value with the same key in the Namespace used to create this store.

Annotations
@Override
getOrComputeIfAbsentback to summary
public <K, V extends @Nullable Object> @Nullable Object getOrComputeIfAbsent(K key, Function<? super K, ? extends V> defaultCreator)

Implements org.junit.jupiter.api.extension.ExtensionContext.Store.getOrComputeIfAbsent.

Doc from org.junit.jupiter.api.extension.ExtensionContext.Store.getOrComputeIfAbsent.

Get the value that is stored under the supplied key.

If no value is stored in the current ExtensionContext for the supplied key, ancestors of the context will be queried for a value with the same key in the Namespace used to create this store. If no value is found for the supplied key, a new value will be computed by the defaultCreator (given the key as input), stored, and returned.

For greater type safety, consider using computeIfAbsent(Object, Function, Class) instead.

If the created value is an instance of CloseableResource or AutoCloseable (unless the junit.jupiter.extensions.store.close.autocloseable.enabled configuration parameter is set to false), then the close() method will be invoked on the stored object when the store is closed.

Annotations
@SuppressWarnings:deprecation
@Override
getOrComputeIfAbsentback to summary
public <K, V extends @Nullable Object> @Nullable V getOrComputeIfAbsent(K key, Function<? super K, ? extends V> defaultCreator, Class<V> requiredType)

Implements org.junit.jupiter.api.extension.ExtensionContext.Store.getOrComputeIfAbsent.

Doc from org.junit.jupiter.api.extension.ExtensionContext.Store.getOrComputeIfAbsent.

Get the value of the specified required type that is stored under the supplied key.

If no value is stored in the current ExtensionContext for the supplied key, ancestors of the context will be queried for a value with the same key in the Namespace used to create this store. If no value is found for the supplied key, a new value will be computed by the defaultCreator (given the key as input), stored, and returned.

If the created value implements CloseableResource or AutoCloseable (unless the junit.jupiter.extensions.store.close.autocloseable.enabled configuration parameter is set to false), then the close() method will be invoked on the stored object when the store is closed.

Annotations
@SuppressWarnings:deprecation
@Override
putback to summary
public void put(Object key, @Nullable Object value)
Annotations
@Override
removeback to summary
public @Nullable Object remove(Object key)

Implements org.junit.jupiter.api.extension.ExtensionContext.Store.remove.

Doc from org.junit.jupiter.api.extension.ExtensionContext.Store.remove.

Remove the value that was previously stored under the supplied key.

The value will only be removed in the current ExtensionContext, not in ancestors. In addition, the CloseableResource and AutoCloseable API will not be honored for values that are manually removed via this method.

For greater type safety, consider using remove(Object, Class) instead.

Annotations
@Override
removeback to summary
public <T> @Nullable T remove(Object key, Class<T> requiredType)

Implements org.junit.jupiter.api.extension.ExtensionContext.Store.remove.

Doc from org.junit.jupiter.api.extension.ExtensionContext.Store.remove.

Remove the value of the specified required type that was previously stored under the supplied key.

The value will only be removed in the current ExtensionContext, not in ancestors. In addition, the CloseableResource and AutoCloseable API will not be honored for values that are manually removed via this method.

Annotations
@Override