public class RestApiResponseBuilder extends RestApiResponseBuilder
additionalCookies, additionalHeaders, characterSet, httpStatus, mediaType, response| Constructor and Description |
|---|
RestApiResponseBuilder() |
| Modifier and Type | Method and Description |
|---|---|
RestApiResponse |
build() |
RestApiResponseBuilder |
withAdditionalCookie(javax.servlet.http.Cookie cookie)
Adds a cookie to the HTTP response
|
RestApiResponseBuilder |
withAdditionalHeader(String name,
String value)
Adds a header in the HTTP response
|
RestApiResponseBuilder |
withCharacterSet(String characterSet)
Set the character set of the HTTP response.
|
RestApiResponseBuilder |
withContentRange(int pageIndex,
int pageSize)
When returning a paged result, sets the start index and the page size.
|
RestApiResponseBuilder |
withContentRange(int pageIndex,
int pageSize,
long totalSize)
When returning a paged result, sets the start index, the page size and the total size.
|
RestApiResponseBuilder |
withMediaType(String mediaType)
Set the media type of the HTTP response body.
|
RestApiResponseBuilder |
withResponse(Serializable response)
Set the body of the response
|
RestApiResponseBuilder |
withResponseStatus(int httpStatus)
Set the HTTP status of the response.
|
public RestApiResponseBuilder withResponse(Serializable response)
withResponse in class RestApiResponseBuilderresponse - the response bodypublic RestApiResponseBuilder withResponseStatus(int httpStatus)
withResponseStatus in class RestApiResponseBuilderhttpStatus - the HTTP status of the responseHttpServletResponsepublic RestApiResponseBuilder withAdditionalHeader(String name, String value)
withAdditionalHeader in class RestApiResponseBuildername - the name of the header to add in the response.value - the value for this headerHttpHeaderspublic RestApiResponseBuilder withAdditionalCookie(javax.servlet.http.Cookie cookie)
withAdditionalCookie in class RestApiResponseBuildercookie - the Cookie to add to the responsepublic RestApiResponseBuilder withCharacterSet(String characterSet)
withCharacterSet in class RestApiResponseBuildercharacterSet - the name of the character setCharsetpublic RestApiResponseBuilder withMediaType(String mediaType)
withMediaType in class RestApiResponseBuildermediaType - the media type to set.public RestApiResponseBuilder withContentRange(int pageIndex, int pageSize)
pageIndex - the start index of the returned page.pageSize - the size of the returned page.RestApiResponseBuilderpublic RestApiResponseBuilder withContentRange(int pageIndex, int pageSize, long totalSize)
pageIndex - the start index of the returned page.pageSize - the size of the returned page.totalSize - the total size of the requested entity.RestApiResponseBuilderpublic RestApiResponse build()
build in class RestApiResponseBuilderCopyright © 2020 Bonitasoft S.A.. All rights reserved.