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