Class WebEndpointResponse<T>
- java.lang.Object
- org.springframework.boot.actuate.endpoint.web.WebEndpointResponse<T>
- Type Parameters:
T
- the type of the response body
public final class WebEndpointResponse<T> extends Object
AWebEndpointResponse
can be returned by an operation on aEndpointWebExtension
to provide additional, web-specific information such as the HTTP status code.- Since:
- 2.0.0
Field Summary
Fields Modifier and Type Field Description static int
STATUS_BAD_REQUEST
400 Bad Request
.static int
STATUS_INTERNAL_SERVER_ERROR
500 Internal Server Error
.static int
STATUS_NO_CONTENT
204 No Content
.static int
STATUS_NOT_FOUND
404 Not Found
.static int
STATUS_OK
200 OK
.static int
STATUS_SERVICE_UNAVAILABLE
503 Service Unavailable
.static int
STATUS_TOO_MANY_REQUESTS
429 Too Many Requests
.
Constructor Summary
Constructors Constructor Description WebEndpointResponse()
Creates a newWebEndpointResponse
with no body and a 200 (OK) status.WebEndpointResponse(int status)
Creates a newWebEndpointResponse
with no body and the givenstatus
.WebEndpointResponse(T body)
Creates a newWebEndpointResponse
with then given body and a 200 (OK) status.WebEndpointResponse(T body, int status)
Creates a newWebEndpointResponse
with then given body and status.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getBody()
Returns the body for the response.int
getStatus()
Returns the status for the response.
Field Detail
STATUS_OK
public static final int STATUS_OK
200 OK
.- See Also:
- Constant Field Values
STATUS_NO_CONTENT
public static final int STATUS_NO_CONTENT
204 No Content
.- See Also:
- Constant Field Values
STATUS_BAD_REQUEST
public static final int STATUS_BAD_REQUEST
400 Bad Request
.- See Also:
- Constant Field Values
STATUS_NOT_FOUND
public static final int STATUS_NOT_FOUND
404 Not Found
.- See Also:
- Constant Field Values
STATUS_TOO_MANY_REQUESTS
public static final int STATUS_TOO_MANY_REQUESTS
429 Too Many Requests
.- See Also:
- Constant Field Values
STATUS_INTERNAL_SERVER_ERROR
public static final int STATUS_INTERNAL_SERVER_ERROR
500 Internal Server Error
.- See Also:
- Constant Field Values
STATUS_SERVICE_UNAVAILABLE
public static final int STATUS_SERVICE_UNAVAILABLE
503 Service Unavailable
.- See Also:
- Constant Field Values
Constructor Detail
WebEndpointResponse
public WebEndpointResponse()
Creates a newWebEndpointResponse
with no body and a 200 (OK) status.
WebEndpointResponse
public WebEndpointResponse(int status)
Creates a newWebEndpointResponse
with no body and the givenstatus
.- Parameters:
status
- the HTTP status
WebEndpointResponse
public WebEndpointResponse(T body)
Creates a newWebEndpointResponse
with then given body and a 200 (OK) status.- Parameters:
body
- the body
WebEndpointResponse
public WebEndpointResponse(T body, int status)
Creates a newWebEndpointResponse
with then given body and status.- Parameters:
body
- the bodystatus
- the HTTP status