Package org.eclipse.microprofile.health
Class HealthCheckResponseBuilder
java.lang.Object
org.eclipse.microprofile.health.HealthCheckResponseBuilder
A builder to construct a health check procedure response.
The HealthCheckResponseBuilder class is reserved for an extension by implementation providers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract HealthCheckResponsebuild()Creates aHealthCheckResponsefrom the current builder.abstract HealthCheckResponseBuilderdown()Sets the status of the health check response toHealthCheckResponse.Status.DOWN.abstract HealthCheckResponseBuilderSets the name of the health check response.abstract HealthCheckResponseBuilderstatus(boolean up) Sets the status of the health check response according to the boolean valueup.abstract HealthCheckResponseBuilderup()Sets the status of the health check response toHealthCheckResponse.Status.UP.abstract HealthCheckResponseBuilderAdds additional boolean data to the health check response.abstract HealthCheckResponseBuilderAdds additional numeric data to the health check response.abstract HealthCheckResponseBuilderAdds additional string data to the health check response.
-
Constructor Details
-
HealthCheckResponseBuilder
public HealthCheckResponseBuilder()
-
-
Method Details
-
name
Sets the name of the health check response. Note: The health check response name is required and needs to be set before the response is constructed.- Parameters:
name- The health check response name- Returns:
- this builder
-
withData
Adds additional string data to the health check response. Puts thevalueidentified bykeyto the data section of the health check response. Additional invocations of awithDatamethod with the samekeyoverride the key-value pair.- Parameters:
key- the identifiervalue- the value- Returns:
- this builder
-
withData
Adds additional numeric data to the health check response. Puts the longvalueidentified bykeyto the data section of the health check response. Additional invocations of awithDatamethod with the samekeyoverride the key-value pair.- Parameters:
key- the identifiervalue- the value- Returns:
- this builder
-
withData
Adds additional boolean data to the health check response. Puts the booleanvalueidentified bykeyto the data section of the health check response. Additional invocations of awithDatamethod with the samekeyoverride the key-value pair.- Parameters:
key- the identifiervalue- the value- Returns:
- this builder
-
up
Sets the status of the health check response toHealthCheckResponse.Status.UP. This implies that the health check was successful.- Returns:
- this builder
-
down
Sets the status of the health check response toHealthCheckResponse.Status.DOWN. This implies that the health check was not successful.- Returns:
- this builder
-
status
Sets the status of the health check response according to the boolean valueup.- Parameters:
up- the status- Returns:
- this builder
-
build
Creates aHealthCheckResponsefrom the current builder.- Returns:
- A new
HealthCheckResponsedefined by this builder
-