Interface IGenericDataHolder
Represents an object that can hold generic key-value based data. A lot of MLEM components extend this class to allow for users to add additional data to them easily.
public interface IGenericDataHolder
- Extension Methods
Methods
GetDataKeys()
Returns all of the generic data that this object stores.
IEnumerable<string> GetDataKeys()
Returns
- IEnumerable<string>
The generic data on this object
GetData<T>(string)
Returns a piece of generic data of the given type on this object.
T GetData<T>(string key)
Parameters
key
stringThe key that the data is stored by
Returns
- T
The data, or default if it doesn't exist
Type Parameters
T
The type of the data stored
SetData(string, object)
Store a piece of generic data on this object.
[Obsolete("This method will be removed in a future update in favor of the generic SetData<T>.")]
void SetData(string key, object data)
Parameters
SetData<T>(string, T)
Store a piece of generic data on this object.
void SetData<T>(string key, T data)
Parameters
key
stringThe key to store the data by
data
TThe data to store in the object
Type Parameters
T