Table of Contents

Method Lookup

Namespace
SodaFlow.Collections
Assembly
SodaFlow.Collections.dll

Lookup<TKey, TIdentity, TState>(CollectionSnapshot<TKey, TIdentity, TState>, TKey)

Returns the two parts of the item for a key, when there is one.

[Pure]
public static Maybe<Item<TIdentity, TState>> Lookup<TKey, TIdentity, TState>(this CollectionSnapshot<TKey, TIdentity, TState> snapshot, TKey key) where TKey : notnull where TIdentity : notnull

Parameters

snapshot CollectionSnapshot<TKey, TIdentity, TState>

The snapshot to look in.

key TKey

The key to look up.

Returns

Maybe<Item<TIdentity, TState>>

The item, or no value when the key is missing.

Type Parameters

TKey

The type of the keys.

TIdentity

The type of the immutable part of an item.

TState

The type of the mutable part of an item.

Lookup<TKey, TState>(StateMap<TKey, TState>, TKey)

Returns the state for a key, when there is one.

[Pure]
public static Maybe<TState> Lookup<TKey, TState>(this StateMap<TKey, TState> states, TKey key) where TKey : notnull

Parameters

states StateMap<TKey, TState>

The state map to look in.

key TKey

The key to look up.

Returns

Maybe<TState>

The state, or no value when the key is missing.

Type Parameters

TKey

The type of the keys.

TState

The type of the mutable part of an item.