UserState Class

public class UserState
extends BotState

Handles persistence of a user state object using the user ID as part of the key.

Constructor Summary

Constructor Description
UserState(Storage withStorage)

Creates a new UserState object.

Method Summary

Modifier and Type Method and Description
java.lang.String getStorageKey(TurnContext turnContext)

Gets the user key to use when reading and writing state to and from storage.

Methods inherited from BotState

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

UserState

public UserState(Storage withStorage)

Creates a new UserState object.

Parameters:

withStorage - The storage provider to use.

Method Details

getStorageKey

public String getStorageKey(TurnContext turnContext)

Gets the user key to use when reading and writing state to and from storage.

Overrides:

UserState.getStorageKey(TurnContext turnContext)

Parameters:

turnContext - The context object for this turn.

Returns:

The key for the channel and sender.

Throws:

java.lang.IllegalArgumentException

Applies to