Table of Contents

Class ValueDictionary

Namespace
Badeend.ValueCollections
Assembly
Badeend.ValueCollections.dll

Initialization methods for ValueDictionary<TKey, TValue>.

public static class ValueDictionary
Inheritance
ValueDictionary
Inherited Members

Methods

CreateBuilderWithCapacity<TKey, TValue>(int)

Construct a new empty dictionary builder with at least the specified initial capacity.

[Pure]
public static ValueDictionary<TKey, TValue>.Builder CreateBuilderWithCapacity<TKey, TValue>(int minimumCapacity) where TKey : notnull

Parameters

minimumCapacity int

Returns

ValueDictionary<TKey, TValue>.Builder

Type Parameters

TKey
TValue

Exceptions

ArgumentOutOfRangeException

minimumCapacity is less than 0.

CreateBuilder<TKey, TValue>()

Create a new empty ValueDictionary<TKey, TValue>.Builder. This builder can then be used to efficiently construct an immutable ValueDictionary<TKey, TValue>.

[Pure]
public static ValueDictionary<TKey, TValue>.Builder CreateBuilder<TKey, TValue>() where TKey : notnull

Returns

ValueDictionary<TKey, TValue>.Builder

Type Parameters

TKey
TValue

CreateBuilder<TKey, TValue>(scoped ReadOnlySpan<KeyValuePair<TKey, TValue>>)

Create a new ValueDictionary<TKey, TValue>.Builder with the provided items as its initial content.

[Pure]
public static ValueDictionary<TKey, TValue>.Builder CreateBuilder<TKey, TValue>(scoped ReadOnlySpan<KeyValuePair<TKey, TValue>> items) where TKey : notnull

Parameters

items ReadOnlySpan<KeyValuePair<TKey, TValue>>

Returns

ValueDictionary<TKey, TValue>.Builder

Type Parameters

TKey
TValue

Exceptions

ArgumentException

items contains duplicate keys.

Create<TKey, TValue>(scoped ReadOnlySpan<KeyValuePair<TKey, TValue>>)

Copy the items into a new ValueDictionary<TKey, TValue>.

[Pure]
public static ValueDictionary<TKey, TValue> Create<TKey, TValue>(scoped ReadOnlySpan<KeyValuePair<TKey, TValue>> items) where TKey : notnull

Parameters

items ReadOnlySpan<KeyValuePair<TKey, TValue>>

Returns

ValueDictionary<TKey, TValue>

Type Parameters

TKey
TValue

Exceptions

ArgumentException

items contains duplicate keys.