org.eclipse.microprofile.health

## Class HealthCheckResponseBuilder

- java.lang.Object
- - org.eclipse.microprofile.health.HealthCheckResponseBuilder

    public abstract class HealthCheckResponseBuilder
    extends Object

A builder to construct a health check procedure response.

The `HealthCheckResponseBuilder` class is reserved for an extension by implementation providers.

### Constructor Summary

Constructors
Constructor and Description
`HealthCheckResponseBuilder()`

### Method Summary

All Methods Instance Methods Abstract Methods
`abstract HealthCheckResponse` `build()` Creates a `HealthCheckResponse` from the current builder.
`abstract HealthCheckResponseBuilder` `down()` Sets the status of the health check response to `HealthCheckResponse.Status.DOWN`.
`abstract HealthCheckResponseBuilder` `name(String name)` Sets the name of the health check response.
`abstract HealthCheckResponseBuilder` `status(boolean up)` Sets the status of the health check response according to the boolean value `up`.
`abstract HealthCheckResponseBuilder` `up()` Sets the status of the health check response to `HealthCheckResponse.Status.UP`.
`abstract HealthCheckResponseBuilder` `withData(String key, boolean value)` Adds additional boolean data to the health check response.
`abstract HealthCheckResponseBuilder` `withData(String key, long value)` Adds additional numeric data to the health check response.
`abstract HealthCheckResponseBuilder` `withData(String key, String value)` Adds additional string data to the health check response.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### HealthCheckResponseBuilder

    public HealthCheckResponseBuilder()

### Method Detail

#### name

    public abstract HealthCheckResponseBuilder name(String 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

    public abstract HealthCheckResponseBuilder withData(String key,
                                                        String value)

Adds additional string data to the health check response. Puts the `value` identified by `key` to the data section of the health check response. Additional invocations of a `withData` method with the same `key` override the key-value pair.

Parameters:
  `key` - the identifier
  `value` - the value
Returns:
  this builder

#### withData

    public abstract HealthCheckResponseBuilder withData(String key,
                                                        long value)

Adds additional numeric data to the health check response. Puts the long `value` identified by `key` to the data section of the health check response. Additional invocations of a `withData` method with the same `key` override the key-value pair.

Parameters:
  `key` - the identifier
  `value` - the value
Returns:
  this builder

#### withData

    public abstract HealthCheckResponseBuilder withData(String key,
                                                        boolean value)

Adds additional boolean data to the health check response. Puts the boolean `value` identified by `key` to the data section of the health check response. Additional invocations of a `withData` method with the same `key` override the key-value pair.

Parameters:
  `key` - the identifier
  `value` - the value
Returns:
  this builder

#### up

    public abstract HealthCheckResponseBuilder up()

Sets the status of the health check response to `HealthCheckResponse.Status.UP`. This implies that the health check was successful.

Returns:
  this builder

#### down

    public abstract HealthCheckResponseBuilder down()

Sets the status of the health check response to `HealthCheckResponse.Status.DOWN`. This implies that the health check was not successful.

Returns:
  this builder

#### status

    public abstract HealthCheckResponseBuilder status(boolean up)

Sets the status of the health check response according to the boolean value `up`.

Parameters:
  `up` - the status
Returns:
  this builder

#### build

    public abstract HealthCheckResponse build()

Creates a `HealthCheckResponse` from the current builder.

Returns:
  A new `HealthCheckResponse` defined by this builder