类 WebEndpointResponse<T>

java.lang.Object
org.springframework.boot.actuate.endpoint.web.WebEndpointResponse<T>
类型参数:
T - the type of the response body

public final class WebEndpointResponse<T> extends Object
A WebEndpointResponse can be returned by an operation on a @EndpointWebExtension to provide additional, web-specific information such as the HTTP status code.
从以下版本开始:
2.0.0
作者:
Stephane Nicoll, Andy Wilkinson, Vedran Pavic
  • 字段详细资料

    • STATUS_OK

      public static final int STATUS_OK
      200 OK.
      另请参阅:
    • STATUS_NO_CONTENT

      public static final int STATUS_NO_CONTENT
      204 No Content.
      另请参阅:
    • STATUS_BAD_REQUEST

      public static final int STATUS_BAD_REQUEST
      400 Bad Request.
      另请参阅:
    • STATUS_NOT_FOUND

      public static final int STATUS_NOT_FOUND
      404 Not Found.
      另请参阅:
    • STATUS_TOO_MANY_REQUESTS

      public static final int STATUS_TOO_MANY_REQUESTS
      429 Too Many Requests.
      另请参阅:
    • STATUS_INTERNAL_SERVER_ERROR

      public static final int STATUS_INTERNAL_SERVER_ERROR
      500 Internal Server Error.
      另请参阅:
    • STATUS_SERVICE_UNAVAILABLE

      public static final int STATUS_SERVICE_UNAVAILABLE
      503 Service Unavailable.
      另请参阅:
  • 构造器详细资料

    • WebEndpointResponse

      public WebEndpointResponse()
      Creates a new WebEndpointResponse with no body and a 200 (OK) status.
    • WebEndpointResponse

      public WebEndpointResponse(int status)
      Creates a new WebEndpointResponse with no body and the given status.
      参数:
      status - the HTTP status
    • WebEndpointResponse

      public WebEndpointResponse(T body)
      Creates a new WebEndpointResponse with the given body and a 200 (OK) status.
      参数:
      body - the body
    • WebEndpointResponse

      public WebEndpointResponse(T body, Producible<?> producible)
      Creates a new WebEndpointResponse with the given body and content type and a 200 (OK) status.
      参数:
      body - the body
      producible - the producible providing the content type
      从以下版本开始:
      2.5.0
    • WebEndpointResponse

      public WebEndpointResponse(T body, MimeType contentType)
      Creates a new WebEndpointResponse with the given body and content type and a 200 (OK) status.
      参数:
      body - the body
      contentType - the content type of the response
      从以下版本开始:
      2.5.0
    • WebEndpointResponse

      public WebEndpointResponse(T body, int status)
      Creates a new WebEndpointResponse with the given body and status.
      参数:
      body - the body
      status - the HTTP status
    • WebEndpointResponse

      public WebEndpointResponse(T body, int status, MimeType contentType)
      Creates a new WebEndpointResponse with the given body and status.
      参数:
      body - the body
      status - the HTTP status
      contentType - the content type of the response
      从以下版本开始:
      2.5.0
  • 方法详细资料

    • getContentType

      public MimeType getContentType()
      Returns the content type of the response.
      返回:
      the content type;
    • getBody

      public T getBody()
      Returns the body for the response.
      返回:
      the body
    • getStatus

      public int getStatus()
      Returns the status for the response.
      返回:
      the status