Class HealthStatusHttpMapper
- java.lang.Object
- org.springframework.boot.actuate.health.HealthStatusHttpMapper
public class HealthStatusHttpMapper extends Object
Map aStatus
to an HTTP status code.- Since:
- 2.0.0
Constructor Summary
Constructors Constructor Description HealthStatusHttpMapper()
Create a new instance.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addStatusMapping(String statusCode, Integer httpStatus)
Add a status mapping to the existing set.void
addStatusMapping(Map<String,Integer> statusMapping)
Add specific status mappings to the existing set.void
addStatusMapping(Status status, Integer httpStatus)
Add a status mapping to the existing set.Map<String,Integer>
getStatusMapping()
Return an immutable view of the status mapping.int
mapStatus(Status status)
Map the specifiedStatus
to an HTTP status code.void
setStatusMapping(Map<String,Integer> statusMapping)
Set specific status mappings.
Constructor Detail
HealthStatusHttpMapper
public HealthStatusHttpMapper()
Create a new instance.
Method Detail
setStatusMapping
public void setStatusMapping(Map<String,Integer> statusMapping)
Set specific status mappings.- Parameters:
statusMapping
- a map of health status code to HTTP status code
addStatusMapping
public void addStatusMapping(Map<String,Integer> statusMapping)
Add specific status mappings to the existing set.- Parameters:
statusMapping
- a map of health status code to HTTP status code
addStatusMapping
public void addStatusMapping(Status status, Integer httpStatus)
Add a status mapping to the existing set.- Parameters:
status
- the status to maphttpStatus
- the http status
addStatusMapping
public void addStatusMapping(String statusCode, Integer httpStatus)
Add a status mapping to the existing set.- Parameters:
statusCode
- the status code to maphttpStatus
- the http status
getStatusMapping
public Map<String,Integer> getStatusMapping()
Return an immutable view of the status mapping.- Returns:
- the http status codes mapped by status name