T - the specific type of request the envelope is forpublic class SpeechletRequestEnvelope<T extends SpeechletRequest> extends Object
SpeechletV2 invocation.SpeechletV2,
IntentRequest,
Session,
Context| Modifier and Type | Class and Description |
|---|---|
static class |
SpeechletRequestEnvelope.Builder<T extends SpeechletRequest>
Builder used to construct a new
SpeechletRequestEnvelope. |
| Modifier and Type | Method and Description |
|---|---|
static <E extends SpeechletRequest> |
builder()
Returns a new builder instance used to construct a new
SpeechletRequestEnvelope. |
static SpeechletRequestEnvelope<?> |
fromJson(byte[] json)
Read a
SpeechletRequestEnvelope from a byte array. |
static SpeechletRequestEnvelope<?> |
fromJson(InputStream in)
Read a
SpeechletRequestEnvelope from an InputStream. |
static SpeechletRequestEnvelope<?> |
fromJson(String json)
Read a
SpeechletRequestEnvelope from a String. |
Context |
getContext()
Returns the context.
|
T |
getRequest()
Returns the request.
|
Session |
getSession()
Returns the session, if present.
|
String |
getVersion()
Returns the envelope version.
|
public static <E extends SpeechletRequest> SpeechletRequestEnvelope.Builder<E> builder()
SpeechletRequestEnvelope.public String getVersion()
public Session getSession()
T
is IntentRequest,
LaunchRequest, or
SessionEndedRequest.public Context getContext()
public T getRequest()
public static SpeechletRequestEnvelope<?> fromJson(InputStream in) throws IOException
SpeechletRequestEnvelope from an InputStream. The byte stream must be
UTF-8 encoded.in - the input stream to read fromIOException - if deserialization failspublic static SpeechletRequestEnvelope<?> fromJson(byte[] json) throws IOException
SpeechletRequestEnvelope from a byte array. The byte array must be UTF-8
encoded.json - the bytes to read from.IOException - if deserialization fails.public static SpeechletRequestEnvelope<?> fromJson(String json) throws IOException
SpeechletRequestEnvelope from a String.json - the String to read fromIOException - if deserialization failsCopyright © 2016. All rights reserved.