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
snapshotCollectionSnapshot<TKey, TIdentity, TState>The snapshot to look in.
keyTKeyThe key to look up.
Returns
Type Parameters
TKeyThe type of the keys.
TIdentityThe type of the immutable part of an item.
TStateThe 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
statesStateMap<TKey, TState>The state map to look in.
keyTKeyThe key to look up.
Returns
- Maybe<TState>
The state, or no value when the key is missing.
Type Parameters
TKeyThe type of the keys.
TStateThe type of the mutable part of an item.