Class ExplodedObjectsManager
- Namespace
- FoundationaLLM.Orchestration.Core.Orchestration
- Assembly
- FoundationaLLM.Orchestration.Core.dll
Manages the exploded objects dictionary ensuring consistency and integrity.
public class ExplodedObjectsManager
- Inheritance
-
ExplodedObjectsManager
- Inherited Members
- Extension Methods
Methods
GetExplodedObjects()
Gets the exploded objects dictionary.
public Dictionary<string, object> GetExplodedObjects()
Returns
- Dictionary<string, object>
A shallow copy of the internal exploded objects dictionary. This only prevents unguarded changes to the key-value pairs but not to the values themselves.
HasKey(string)
Indicates whether the exploded objects dictionary contains the specified key.
public bool HasKey(string key)
Parameters
key
stringThe key being searched for.
Returns
- bool
true if the key is present in the dictionary (even if the associated value is null), false otherwise.
TryAdd(string, object)
Adds a new key value pair to the exploded objects dictionary.
public bool TryAdd(string key, object value)
Parameters
key
stringThe key of the object to add to the dictionary.
value
objectThe object to add to the dictionary.
Returns
Remarks
The first attempt to add an object always wins. This means that if the key already exists in the dictionary, the add operation will have no effect and it will not generate an exception either.
TryGet<T>(string, out T?)
Tries to get the value associated with the specified key.
public bool TryGet<T>(string key, out T? value) where T : class
Parameters
key
stringThe key being searched for.
value
TThe value being searched for.
Returns
- bool
The typed object associated with the specified key.
Type Parameters
T
The type of the value associated with the key.