Class KevlarProperties
- Namespace
- Kevlar
- Assembly
- Kevlar.dll
A strongly typed property bag carried by KevlarContext for passing custom data between the caller, execution delegate, and strategy callbacks. The bag is pooled with its context and must not be retained beyond the current callback or delegate. A completion callback receives this same live bag immediately before it is recycled; copy required values into caller-owned state rather than retaining the bag.
public sealed class KevlarProperties
- Inheritance
-
KevlarProperties
- Inherited Members
Properties
Count
Gets the number of values currently stored in the bag.
public int Count { get; }
Property Value
Methods
Contains<T>(KevlarKey<T>)
Returns whether a value is stored under the given key.
public bool Contains<T>(KevlarKey<T> key)
Parameters
keyKevlarKey<T>
Returns
Type Parameters
T
GetOrDefault<T>(KevlarKey<T>, T)
Reads the value stored under the given key, or returns defaultValue.
public T GetOrDefault<T>(KevlarKey<T> key, T defaultValue = default)
Parameters
keyKevlarKey<T>defaultValueT
Returns
- T
Type Parameters
T
Remove<T>(KevlarKey<T>)
Removes the value stored under the given key.
public bool Remove<T>(KevlarKey<T> key)
Parameters
keyKevlarKey<T>
Returns
Type Parameters
T
Set<T>(KevlarKey<T>, T)
Stores a value under the given key, replacing any existing value.
public void Set<T>(KevlarKey<T> key, T value)
Parameters
keyKevlarKey<T>valueT
Type Parameters
T
TryGet<T>(KevlarKey<T>, out T)
Attempts to read the value stored under the given key.
public bool TryGet<T>(KevlarKey<T> key, out T value)
Parameters
keyKevlarKey<T>valueT
Returns
Type Parameters
T