public class SpeechletResponseEnvelope extends Object
SpeechletV2 invocation as well as mutable elements of
the SpeechletV2 invocation parameters.SpeechletResponse| Constructor and Description |
|---|
SpeechletResponseEnvelope() |
| Modifier and Type | Method and Description |
|---|---|
SpeechletResponse |
getResponse()
Returns the
SpeechletV2 response. |
Map<String,Object> |
getSessionAttributes()
Returns the session attributes to send back to the server.
|
String |
getVersion()
Returns the envelope version.
|
void |
setResponse(SpeechletResponse response)
Sets the
SpeechletV2 response. |
void |
setSessionAttributes(Map<String,Object> sessionAttributes)
Sets the session attributes to send back to the server.
|
void |
setVersion(String version)
Sets the envelope version.
|
void |
toJson(OutputStream out)
Write a
SpeechletResponseEnvelope to an OutputStream. |
byte[] |
toJsonBytes()
Write a
SpeechletResponseEnvelope as a JSON byte array. |
String |
toJsonString()
Write a
SpeechletResponseEnvelope as a JSON String. |
public String getVersion()
public void setVersion(String version)
version - the envelope version to setpublic SpeechletResponse getResponse()
SpeechletV2 response.public void setResponse(SpeechletResponse response)
SpeechletV2 response.response - the response to setpublic Map<String,Object> getSessionAttributes()
public void setSessionAttributes(Map<String,Object> sessionAttributes)
sessionAttributes - the session attributes to setpublic void toJson(OutputStream out) throws IOException
SpeechletResponseEnvelope to an OutputStream. The output is encoded
using UTF-8.out - the OutputStream to write toIOException - if serialization failspublic byte[] toJsonBytes()
throws IOException
SpeechletResponseEnvelope as a JSON byte array. The output is encoded using
UTF-8.IOException - if serialization failspublic String toJsonString() throws IOException
SpeechletResponseEnvelope as a JSON String.IOException - if serialization failsCopyright © 2016. All rights reserved.