Package com.opencloud.slee.rest.common
Interface RestResponseCreator
-
public interface RestResponseCreator
The interface between generated event classes and the REST RA.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RestResponseBuilder
createResponse(int statusCode, java.lang.String api, java.lang.String operationId)
Create a new response<T> java.lang.String
encodeHeaderListValue(java.lang.Class<T> elementType, java.util.List<T> value)
<T> java.lang.String
encodeHeaderValue(java.lang.Class<T> type, T value)
byte[]
encodeResponseBody(java.lang.String contentType, java.lang.Object responseBody)
Encode the response body
-
-
-
Method Detail
-
createResponse
RestResponseBuilder createResponse(int statusCode, java.lang.String api, java.lang.String operationId)
Create a new response- Parameters:
statusCode
- the response status codeapi
- the api the operation is foroperationId
- the corresponding operation-id- Returns:
- a new response builder implementation
-
encodeResponseBody
byte[] encodeResponseBody(java.lang.String contentType, java.lang.Object responseBody)
Encode the response body- Parameters:
contentType
- content type for the response bodyresponseBody
- the response body- Returns:
- the encoded response body
-
encodeHeaderValue
<T> java.lang.String encodeHeaderValue(java.lang.Class<T> type, T value)
-
encodeHeaderListValue
<T> java.lang.String encodeHeaderListValue(java.lang.Class<T> elementType, java.util.List<T> value)
-
-