public class ResponseCreators
extends java.lang.Object
ResponseBuilder
for building common types of responsesModifier and Type | Method and Description |
---|---|
static ResponseBuilder |
badRequest()
Builds a 400 response
|
static ResponseBuilder |
created() |
static ResponseBuilder |
created(java.lang.String locationHeaderValue)
Builds a 201 response with a given location header value
|
static ResponseBuilder |
forbidden()
Builds a 403 response
|
static ResponseBuilder |
noContent()
Builds a 204 response
|
static ResponseBuilder |
notFound() |
static ResponseBuilder |
serverError()
Builds a 500 response
|
static ResponseBuilder |
success()
Builds a 200 response
|
static ResponseBuilder |
success(HttpBodyConverter httpBodyConverter) |
static ResponseBuilder |
success(java.lang.String body,
java.lang.String contentType)
Builds a 200 response with the following content
|
static ResponseBuilder |
unauthorised()
Builds a 401 response
|
public static ResponseBuilder created(java.lang.String locationHeaderValue)
locationHeaderValue
- the value of the location headerpublic static ResponseBuilder created()
public static ResponseBuilder success(java.lang.String body, java.lang.String contentType)
body
- the body sent in the responsecontentType
- the content type header valuepublic static ResponseBuilder success()
public static ResponseBuilder noContent()
public static ResponseBuilder badRequest()
public static ResponseBuilder serverError()
public static ResponseBuilder forbidden()
public static ResponseBuilder unauthorised()
public static ResponseBuilder notFound()
public static ResponseBuilder success(HttpBodyConverter httpBodyConverter)