public class DefaultApp implements App
Default implementation of an Actions App. This class provides most of the functionality of an App such as request parsing and routing.
Modifier and Type | Field and Description |
---|---|
static com.google.actions.api.DefaultApp.Companion |
Companion
Deprecated.
|
Constructor and Description |
---|
DefaultApp()
Default implementation of an Actions App. This class provides most of the
functionality of an App such as request parsing and routing.
|
Modifier and Type | Method and Description |
---|---|
ActionRequest |
createRequest(java.lang.String inputJson,
java.util.Map<?,?> headers)
Creates an ActionRequest for the specified JSON and metadata.
|
java.lang.String |
getErrorMsg_badReturnValue() |
ResponseBuilder |
getResponseBuilder(ActionRequest request) |
java.util.concurrent.CompletableFuture<java.lang.String> |
handleError(java.lang.Exception exception) |
java.util.concurrent.CompletableFuture<java.lang.String> |
handleRequest(java.lang.String inputJson,
java.util.Map<?,?> headers)
Processes the incoming JSON request and returns JSON as described in the
Actions on Google conversation protocol.
|
java.util.concurrent.CompletableFuture<com.google.actions.api.ActionResponse> |
routeRequest(ActionRequest request) |
handleRequest
public static com.google.actions.api.DefaultApp.Companion Companion
public DefaultApp()
Default implementation of an Actions App. This class provides most of the functionality of an App such as request parsing and routing.
public java.lang.String getErrorMsg_badReturnValue()
public ActionRequest createRequest(java.lang.String inputJson, java.util.Map<?,?> headers)
Creates an ActionRequest for the specified JSON and metadata.
inputJson
- The input JSON.headers
- Map containing metadata, usually from the HTTP request
headers.public ResponseBuilder getResponseBuilder(ActionRequest request)
public java.util.concurrent.CompletableFuture<java.lang.String> handleRequest(java.lang.String inputJson, java.util.Map<?,?> headers)
Processes the incoming JSON request and returns JSON as described in the Actions on Google conversation protocol.
public java.util.concurrent.CompletableFuture<com.google.actions.api.ActionResponse> routeRequest(ActionRequest request)
public java.util.concurrent.CompletableFuture<java.lang.String> handleError(java.lang.Exception exception)