BotStateMemoryScope<T> Class

Type Parameters

T

The BotState type.

public class BotStateMemoryScope<T>
extends MemoryScope

BotStateMemoryScope represents a BotState scoped memory.

Constructor Summary

Constructor Description
BotStateMemoryScope(Class<T> type, String name)

Initializes a new instance of the TurnMemoryScope class.

Method Summary

Modifier and Type Method and Description
final java.lang.Object getMemory(DialogContext dialogContext)

Get the backing memory for this scope.

java.util.concurrent.CompletableFuture<java.lang.Void> load(DialogContext dialogContext, Boolean force)

Populates the state cache for this from the storage layer.

java.util.concurrent.CompletableFuture<java.lang.Void> saveChanges(DialogContext dialogContext, Boolean force)

Writes the state cache for this to the storage layer.

final void setMemory(DialogContext dialogContext, Object memory)

Changes the backing Object for the memory scope.

Methods inherited from MemoryScope

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

BotStateMemoryScope

public BotStateMemoryScope(Class type, String name)

Initializes a new instance of the TurnMemoryScope class.

Parameters:

type - The Type of T that is being created.
name - Name of the property.

Method Details

getMemory

public final Object getMemory(DialogContext dialogContext)

Get the backing memory for this scope.

Overrides:

BotStateMemoryScope<T>.getMemory(DialogContext dialogContext)

Parameters:

dialogContext

load

public CompletableFuture load(DialogContext dialogContext, Boolean force)

Populates the state cache for this from the storage layer.

Overrides:

BotStateMemoryScope<T>.load(DialogContext dialogContext, Boolean force)

Parameters:

dialogContext
force

saveChanges

public CompletableFuture saveChanges(DialogContext dialogContext, Boolean force)

Writes the state cache for this to the storage layer.

Overrides:

BotStateMemoryScope<T>.saveChanges(DialogContext dialogContext, Boolean force)

Parameters:

dialogContext
force

Returns:

A future that represents the

setMemory

public final void setMemory(DialogContext dialogContext, Object memory)

Changes the backing Object for the memory scope.

Overrides:

BotStateMemoryScope<T>.setMemory(DialogContext dialogContext, Object memory)

Parameters:

dialogContext
memory

Applies to