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