@ProviderType public interface ApiResponseBuilder
| Modifier and Type | Method and Description |
|---|---|
ApiResponse |
build()
Build the ApiResponse instance with the values specified in this ApiRespoonseBuilder.
|
ApiResponseBuilder |
setBody(Object body)
Set the body to be returned in the response.
|
ApiResponseBuilder |
setContentType(String contentType)
Set the content type of the body.
|
ApiResponseBuilder |
setEntity(Resource entity)
Set an entity to be used as the response body.
|
ApiResponseBuilder |
setStatus(Integer code,
String message)
Set the HTTP status
|
ApiResponseBuilder |
withChange(Modification modification)
Add a Modification to be returned in the changes section of the response.
|
ApiResponseBuilder |
withHeader(String key,
String value)
Set an HTTP header to be used in the response.
|
ApiResponseBuilder |
withHeader(String key,
String[] values)
Set an HTTP header with multiple values.
|
ApiResponseBuilder setStatus(Integer code, String message)
code - The status codemessage - The status messageApiResponseBuilder withHeader(String key, String value)
key - The HTTP header namevalue - The HTTP header valueApiResponseBuilder withHeader(String key, String[] values)
key - The HTTP header namevalues - The HTTP header valuesApiResponseBuilder setEntity(Resource entity)
entity - A resource to be used as the entityApiResponseBuilder setBody(Object body)
body - An instance of CharSequence or a byte[] to be used in the body of the response.ApiResponseBuilder setContentType(String contentType)
contentType - The content type.ApiResponseBuilder withChange(Modification modification)
modification - The Modification to be added.ApiResponse build()
Copyright © 2010 - 2020 Adobe. All Rights Reserved