StatePropertyAccessor<T> Interface

Type Parameters

T

type of the property.

Implements

public interface StatePropertyAccessor<T>
extends StatePropertyInfo

Interface which defines methods for how you can get data from a property source such as BotState.

Method Summary

Modifier and Type Method and Description
abstract java.util.concurrent.CompletableFuture<java.lang.Void> delete(TurnContext turnContext)

Delete the property from the source.

default java.util.concurrent.CompletableFuture<T> get(TurnContext turnContext)

Get the property value from the source.

abstract java.util.concurrent.CompletableFuture<T> get(TurnContext turnContext, Supplier<T> defaultValueFactory)

Get the property value from the source.

abstract java.util.concurrent.CompletableFuture<java.lang.Void> set(TurnContext turnContext, T value)

Set the property value on the source.

Method Details

delete

public abstract CompletableFuture delete(TurnContext turnContext)

Delete the property from the source.

Parameters:

turnContext - TurnContext.

Returns:

A task representing the result of the asynchronous operation.

get

public default CompletableFuture get(TurnContext turnContext)

Get the property value from the source.

Parameters:

turnContext - TurnContext.

Returns:

A task representing the result of the asynchronous operation.

get

public abstract CompletableFuture get(TurnContext turnContext, Supplier defaultValueFactory)

Get the property value from the source.

Parameters:

turnContext - TurnContext.
defaultValueFactory - Function which defines the property value to be returned if no value has been set.

Returns:

A task representing the result of the asynchronous operation.

set

public abstract CompletableFuture set(TurnContext turnContext, T value)

Set the property value on the source.

Parameters:

turnContext - TurnContext.
value - The value to set.

Returns:

A task representing the result of the asynchronous operation.

Applies to