Class: DefaultResponseBuilder

DefaultResponseBuilder

new DefaultResponseBuilder()

Builder to build a response Allows only the sections of the response that you care about to be set and provides defaults for everything else
Implements:
Source:

Methods

build() → {Response}

Builds the final response based on all of the merging
Implements:
Source:
Returns:
The response
Type
Response

withFormatterManager(formatterManager) → {ResponseBuilder}

Sets the FormatterManager of the response
Parameters:
Name Type Description
formatterManager FormatterManager The FormatterManager for use with the response
Implements:
Source:
Returns:
The instance of the ResponseBuilder
Type
ResponseBuilder

withJSON(json) → {ResponseBuilder}

The passed in JSON will be merged with a response definition
Parameters:
Name Type Description
json JSON JSON that matches the parts of a response definition that is to be set
Implements:
Source:
Returns:
The instance of the ResponseBuilder
Type
ResponseBuilder

withResponseFormats(responseFormats) → {ResponseBuilder}

Sets the response formats. This is the main JSON (such as for Custom or SmartHome) that is used as a template to shorten all responses from skill developers
Parameters:
Name Type Description
responseFormats Map Map of responseFormatters
Source:
Returns:
The instance of the ResponseBuilder
Type
ResponseBuilder

withResponseId(responseId) → {ResponseBuilder}

Sets the id of the response
Parameters:
Name Type Description
responseId String The id of the response
Implements:
Source:
Returns:
The instance of the ResponseBuilder
Type
ResponseBuilder

withString(string) → {ResponseBuilder}

The passed in String will converted to JSON and merged with a response definition
Parameters:
Name Type Description
string String String that when converted to JSON matches the parts of a response definition that is to be set
Implements:
Source:
Returns:
The instance of the ResponseBuilder
Type
ResponseBuilder