Interface ConverterResponseBuilder
A builder for creating ConverterResponse objects.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build a ConverterResponse object with the values set in this builder.Set the body of the response.setContentType(String contentType) Set the content type of the response.withHeader(String key, String value) Add a specific header with a single value to the response.withHeader(String key, String[] values) Add a specific header with multiple values to the response.
-
Method Details
-
withHeader
Add a specific header with a single value to the response.- Parameters:
key- The header's key.value- The header's value.- Returns:
- This ConverterResponseBuilder object.
-
withHeader
Add a specific header with multiple values to the response.- Parameters:
key- The header's key.values- The header's values.- Returns:
- This ConverterResponseBuilder object
-
setBody
Set the body of the response. The body should be an instance of CharSequence or a byte[].- Parameters:
body- The body.- Returns:
- This ConverterResponseBuilder object.
-
setContentType
Set the content type of the response.- Parameters:
contentType- The content type.- Returns:
- This ConverterResponseBuilder object.
-
build
Build a ConverterResponse object with the values set in this builder.- Returns:
- A ConverterResponse.
-