T
- the type of the response bodypublic final class WebEndpointResponse<T> extends Object
WebEndpointResponse
can be returned by an operation on a
WebEndpointExtension
to provide additional, web-specific information such as
the HTTP status code.Constructor and Description |
---|
WebEndpointResponse()
Creates a new
WebEndpointResponse with no body and a 200 (OK) status. |
WebEndpointResponse(int status)
Creates a new
WebEndpointResponse with no body and the given
status . |
WebEndpointResponse(T body)
Creates a new
WebEndpointResponse with then given body and a 200 (OK)
status. |
WebEndpointResponse(T body,
int status)
Creates a new
WebEndpointResponse with then given body and status. |
Modifier and Type | Method and Description |
---|---|
T |
getBody()
Returns the body for the response.
|
int |
getStatus()
Returns the status for the response.
|
public WebEndpointResponse()
WebEndpointResponse
with no body and a 200 (OK) status.public WebEndpointResponse(int status)
WebEndpointResponse
with no body and the given
status
.status
- the HTTP statuspublic WebEndpointResponse(T body)
WebEndpointResponse
with then given body and a 200 (OK)
status.body
- the bodypublic WebEndpointResponse(T body, int status)
WebEndpointResponse
with then given body and status.body
- the bodystatus
- the HTTP statuspublic T getBody()
public int getStatus()
Copyright © 2017 Pivotal Software, Inc.. All rights reserved.