类 Health.Builder
java.lang.Object
org.springframework.boot.actuate.health.Health.Builder
- 封闭类:
Health
Builder for creating immutable
Health
instances.-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明build()
Create a newHealth
instance with the previously specified code and details.down()
Set status toStatus.DOWN
.Set status toStatus.DOWN
and add details for givenThrowable
.Set status toStatus.OUT_OF_SERVICE
.Set status to givenstatusCode
.Set status to givenStatus
instance.unknown()
Set status toStatus.UNKNOWN
status.up()
Set status toStatus.UP
status.withDetail
(String key, Object value) Record detail using givenkey
andvalue
.withDetails
(Map<String, ?> details) Record details from the givendetails
map.Record detail for givenException
.
-
构造器详细资料
-
Builder
public Builder()Create new Builder instance. -
Builder
Create new Builder instance, setting status to givenstatus
.- 参数:
status
- theStatus
to use
-
Builder
Create new Builder instance, setting status to givenstatus
and details to givendetails
.
-
-
方法详细资料
-
withException
Record detail for givenException
.- 参数:
ex
- the exception- 返回:
- this
Health.Builder
instance
-
withDetail
Record detail using givenkey
andvalue
.- 参数:
key
- the detail keyvalue
- the detail value- 返回:
- this
Health.Builder
instance
-
withDetails
Record details from the givendetails
map. Keys from the given map replace any existing keys if there are duplicates.- 参数:
details
- map of details- 返回:
- this
Health.Builder
instance - 从以下版本开始:
- 2.1.0
-
unknown
Set status toStatus.UNKNOWN
status.- 返回:
- this
Health.Builder
instance
-
up
Set status toStatus.UP
status.- 返回:
- this
Health.Builder
instance
-
down
Set status toStatus.DOWN
and add details for givenThrowable
.- 参数:
ex
- the exception- 返回:
- this
Health.Builder
instance
-
down
Set status toStatus.DOWN
.- 返回:
- this
Health.Builder
instance
-
outOfService
Set status toStatus.OUT_OF_SERVICE
.- 返回:
- this
Health.Builder
instance
-
status
Set status to givenstatusCode
.- 参数:
statusCode
- the status code- 返回:
- this
Health.Builder
instance
-
status
Set status to givenStatus
instance.- 参数:
status
- the status- 返回:
- this
Health.Builder
instance
-
build
Create a newHealth
instance with the previously specified code and details.- 返回:
- a new
Health
instance
-