public class SimpleHttpResponseFactory extends java.lang.Object implements HttpResponseFactory
HttpResponseFactory
implementation.
This is the default fallback factory.INSTANCE
Constructor and Description |
---|
SimpleHttpResponseFactory() |
Modifier and Type | Method and Description |
---|---|
<T> MutableHttpResponse<T> |
ok(T body)
Creates an
HttpStatus.OK response with a body. |
<T> MutableHttpResponse<T> |
status(HttpStatus status,
java.lang.String reason)
Return a response for the given status.
|
<T> MutableHttpResponse<T> |
status(HttpStatus status,
T body)
Return a response for the given status.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
ok, status
public <T> MutableHttpResponse<T> ok(T body)
HttpResponseFactory
HttpStatus.OK
response with a body.ok
in interface HttpResponseFactory
T
- The body typebody
- The bodypublic <T> MutableHttpResponse<T> status(HttpStatus status, java.lang.String reason)
HttpResponseFactory
status
in interface HttpResponseFactory
T
- The response typestatus
- The statusreason
- An alternatively reason messagepublic <T> MutableHttpResponse<T> status(HttpStatus status, T body)
HttpResponseFactory
status
in interface HttpResponseFactory
T
- The body typestatus
- The statusbody
- The body