ApiProviderMap

public interface ApiProviderMap<K, V>

A fast thread-safe copy-on-write map meant to be used as the backing storage for registered providers. See ApiLookupMap for a usage example.

Note: This map allows very fast lock-free concurrent reads, but in exchange writes are very expensive and should not be too frequent. Also, keys are compared by reference ({@code ==}) and not using equals.

Parameters

<K>

The key type of the map, compared by reference ({@code ==}).

<V>

The value type of the map.

Functions

create
Link copied to clipboard
static ApiProviderMap<K, Vcreate<K, V>()
Create a new instance.
get
Link copied to clipboard
@Nullable()
abstract V get(K key)
Return the provider to which the specified key is mapped,or {@code null} if this map contains no mapping for the key.
putIfAbsent
Link copied to clipboard
abstract V putIfAbsent(K key, V provider)
If the specified key is not already associated with a provider,associate it with the given value and return {@code null}, else return the current value.

Inheritors

ApiProviderHashMap
Link copied to clipboard

Sources

jvm source
Link copied to clipboard