TurnContextStateCollection Class
- java.
lang. Object - com.
microsoft. bot. builder. TurnContextStateCollection
- com.
Implements
public class TurnContextStateCollection
implements java.lang.AutoCloseable
Represents a set of collection of services associated with the TurnContext.
Constructor Summary
| Constructor | Description | |
|---|---|---|
| TurnContextStateCollection() | ||
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| void |
<T>add(T value)
Add a service using its type name (Class#getName() as the key. |
| void |
<T>add(String key, T value)
Adds a value to the turn's context. |
| T |
<T>get(Class<T> type)
Get a service by type using its full type name as the key. |
| T |
<T>get(String key)
Get a value. |
| void |
<T>replace(T value)
Replaces a value. |
| void |
close()
Close all contained AutoCloseable values. |
| boolean |
containsKey(String key)
Returns true if this contains a mapping for the specified key. |
| void |
copy(TurnContextStateCollection other)
Copy the values from another Turn |
| void |
finalize()
Auto call of #close. |
| java.util.Map<java.lang.String,java.lang.Object> |
getTurnStateServices()
Returns the Services stored in the Turn |
| void |
remove(String key)
Removes a value. |
| void |
replace(String key, Object value)
Replaces a value. |
Methods inherited from java.lang.Object
Constructor Details
TurnContextStateCollection
public TurnContextStateCollection()
Method Details
<T>add
public void
Add a service using its type name (Class#getName() as the key.
Parameters:
Throws:
<T>add
public void
Adds a value to the turn's context.
Parameters:
Throws:
<T>get
public T
Get a service by type using its full type name as the key.
Parameters:
Returns:
<T>get
public T
Get a value.
Parameters:
Returns:
Throws:
<T>replace
public void
Replaces a value.
Parameters:
close
public void close()
Close all contained AutoCloseable values.
Throws:
containsKey
public boolean containsKey(String key)
Returns true if this contains a mapping for the specified key.
Parameters:
Returns:
copy
public void copy(TurnContextStateCollection other)
Copy the values from another TurnContextStateCollection.
Parameters:
finalize
public void finalize()
Auto call of #close.
Overrides:
TurnContextStateCollection.finalize()getTurnStateServices
public Map
Returns the Services stored in the TurnContextStateCollection.
Returns:
remove
public void remove(String key)
Removes a value.
Parameters:
replace
public void replace(String key, Object value)
Replaces a value.
Parameters: