public final class Context extends Object
SpeechletRequest containing the state of the interfaces.| Modifier and Type | Class and Description |
|---|---|
static class |
Context.Builder
Builder used to construct a new
Context. |
| Modifier and Type | Method and Description |
|---|---|
static Context.Builder |
builder()
Returns a new builder instance used to construct a new
Context. |
<T extends Interface,S extends State<T>> |
getState(Class<T> interfaceClass,
Class<S> castClass)
Returns
State for interface if it exists, null otherwise. |
<T extends Interface> |
hasState(Class<T> clazz)
Returns true if context has
State for the interface, false otherwise. |
public static Context.Builder builder()
Context.public <T extends Interface> boolean hasState(Class<T> clazz)
State for the interface, false otherwise.T - the interface subtypeclazz - the interface classState for the interface, false otherwisepublic <T extends Interface,S extends State<T>> S getState(Class<T> interfaceClass, Class<S> castClass)
State for interface if it exists, null otherwise.T - the interface subtypeS - the state type for the interfaceinterfaceClass - the interface classcastClass - the class type that should be returned by this method. This is typically denoted
by a static field called STATE_TYPE of the interfaceClass.Copyright © 2016. All rights reserved.