Package com.adobe.granite.haf.api
Interface ApiResponse
An interface for providing the framework with custom values to be used in the response. An instance of ApiResponse
is read only. To create an ApiResponse use ApiResponseBuilder.
-
Method Summary
Modifier and TypeMethodDescriptiongetBody()Get the body to returned in the response.Get the content type of the body returned by this ApiResponse.Get the entity to be used as the body in the response.Get the HTTP headers to be added to the response.Get the HTTP status code to be used in the response.Get the HTTP status message to be used in the response.
-
Method Details
-
getStatusCode
Get the HTTP status code to be used in the response.- Returns:
- The HTTP status code
-
getStatusMessage
Get the HTTP status message to be used in the response.- Returns:
- The HTTP status message
-
getHeaders
Get the HTTP headers to be added to the response.- Returns:
- The HTTP headers
-
getEntity
Get the entity to be used as the body in the response. The entity must be a Resource that can be understood by the HTTP API framework.- Returns:
- The entity Resouce to be used as the response body.
-
getBody
Get the body to returned in the response. This allows free-form response bodies, beyond the resource covered by getEntity. This method is mutually exclusive to getEntity and if this method return non-null it will be used in the response and getEntity will be ignored.- Returns:
- An instance of CharSequence or a byte[] to be used as the response body
-
getContentType
Get the content type of the body returned by this ApiResponse. This method is only used when returning a free form body using the getBody() method.- Returns:
- The content type of the body
-
getChanges
-