public class MessageResponse extends GenericModel
ConversationService.message(String, MessageRequest)
.Modifier and Type | Class and Description |
---|---|
static class |
MessageResponse.Entity
An class used to describe the entity payload object.
|
static class |
MessageResponse.Intent
A class representing an Intent as detected by the service.
|
Constructor and Description |
---|
MessageResponse() |
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
getContext()
Returns the context as returned by the service.
|
List<MessageResponse.Entity> |
getEntities()
Returns the list of entities as detected by the service.
|
List<MessageResponse.Intent> |
getIntents()
Returns the list of intents as detected by the service.
|
Map<String,Object> |
getOutput()
Returns the output as returned by the service, may be null.
|
String |
getText()
A convenience method for getting the text property from the output object.
|
void |
setContext(Map<String,Object> context)
Sets the context as determined by the service.
|
void |
setEntities(List<MessageResponse.Entity> entities)
Sets a list of entities as detected by the service.
|
void |
setIntents(List<MessageResponse.Intent> intents)
Sets a list of intents as detected by the service.
|
void |
setOutput(Map<String,Object> output)
Sets the output as returned by the service.
|
equals, hashCode, toString
public Map<String,Object> getContext()
public List<MessageResponse.Entity> getEntities()
MessageResponse.Entity
objectspublic List<MessageResponse.Intent> getIntents()
MessageResponse.Intent
objects.public Map<String,Object> getOutput()
public void setContext(Map<String,Object> context)
context
- a map of key value pairspublic void setEntities(List<MessageResponse.Entity> entities)
entities
- an array of entitiespublic void setIntents(List<MessageResponse.Intent> intents)
intents
- an array of intentspublic void setOutput(Map<String,Object> output)
output
- a map of outputs as defined by the conversation designerpublic String getText()
String text = null; Mapoutput = response.getOutput(); return if(output != null){ text = output.get("text"); }
Copyright © 2015–2016. All rights reserved.