Class SimpleHttpCodeStatusMapper
java.lang.Object
org.springframework.boot.actuate.health.SimpleHttpCodeStatusMapper
- All Implemented Interfaces:
HttpCodeStatusMapper
Simple
HttpCodeStatusMapper backed by map of status
code to HTTP status code.- Since:
- 2.2.0
- Author:
- Stephane Nicoll, Phillip Webb
-
Field Summary
Fields inherited from interface org.springframework.boot.actuate.health.HttpCodeStatusMapper
DEFAULT -
Constructor Summary
ConstructorsConstructorDescriptionCreate a newSimpleHttpCodeStatusMapperinstance using default mappings.SimpleHttpCodeStatusMapper(Map<String, Integer> mappings) Create a newSimpleHttpCodeStatusMapperwith the specified mappings. -
Method Summary
Modifier and TypeMethodDescriptionintgetStatusCode(Status status) Return the HTTP status code that corresponds to the givenhealth status.
-
Constructor Details
-
SimpleHttpCodeStatusMapper
public SimpleHttpCodeStatusMapper()Create a newSimpleHttpCodeStatusMapperinstance using default mappings. -
SimpleHttpCodeStatusMapper
Create a newSimpleHttpCodeStatusMapperwith the specified mappings.- Parameters:
mappings- the mappings to use ornullto use the default mappings
-
-
Method Details
-
getStatusCode
Description copied from interface:HttpCodeStatusMapperReturn the HTTP status code that corresponds to the givenhealth status.- Specified by:
getStatusCodein interfaceHttpCodeStatusMapper- Parameters:
status- the health status to map- Returns:
- the corresponding HTTP status code
-