Constructor and Description |
---|
Builder()
Create new Builder instance.
|
Builder(Status status)
Create new Builder instance, setting status to given
status . |
Builder(Status status,
Map<String,?> details)
Create new Builder instance, setting status to given
status and details
to given details . |
Modifier and Type | Method and Description |
---|---|
Health |
build()
Create a new
Health instance with the previously specified code and
details. |
Health.Builder |
down()
Set status to
Status.DOWN . |
Health.Builder |
down(Throwable ex)
Set status to
Status.DOWN and add details for given Throwable . |
Health.Builder |
outOfService()
Set status to
Status.OUT_OF_SERVICE . |
Health.Builder |
status(Status status)
Set status to given
Status instance. |
Health.Builder |
status(String statusCode)
Set status to given
statusCode . |
Health.Builder |
unknown()
Set status to
Status.UNKNOWN status. |
Health.Builder |
up()
Set status to
Status.UP status. |
Health.Builder |
withDetail(String key,
Object value)
Record detail using given
key and value . |
Health.Builder |
withDetails(Map<String,?> details)
Record details from the given
details map. |
Health.Builder |
withException(Throwable ex)
Record detail for given
Exception . |
public Builder()
public Builder(Status status)
status
.status
- the Status
to usepublic Health.Builder withException(Throwable ex)
Exception
.ex
- the exceptionHealth.Builder
instancepublic Health.Builder withDetail(String key, Object value)
key
and value
.key
- the detail keyvalue
- the detail valueHealth.Builder
instancepublic Health.Builder withDetails(Map<String,?> details)
details
map. Keys from the given map
replace any existing keys if there are duplicates.details
- map of detailsHealth.Builder
instancepublic Health.Builder unknown()
Status.UNKNOWN
status.Health.Builder
instancepublic Health.Builder up()
Status.UP
status.Health.Builder
instancepublic Health.Builder down(Throwable ex)
Status.DOWN
and add details for given Throwable
.ex
- the exceptionHealth.Builder
instancepublic Health.Builder down()
Status.DOWN
.Health.Builder
instancepublic Health.Builder outOfService()
Status.OUT_OF_SERVICE
.Health.Builder
instancepublic Health.Builder status(String statusCode)
statusCode
.statusCode
- the status codeHealth.Builder
instancepublic Health.Builder status(Status status)
Status
instance.status
- the statusHealth.Builder
instanceCopyright © 2021 Pivotal Software, Inc.. All rights reserved.