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
ConstructorDescriptionCreate a newSimpleHttpCodeStatusMapper
instance using default mappings.SimpleHttpCodeStatusMapper
(Map<String, Integer> mappings) Create a newSimpleHttpCodeStatusMapper
with the specified mappings. -
Method Summary
Modifier and TypeMethodDescriptionint
getStatusCode
(Status status) Return the HTTP status code that corresponds to the givenhealth status
.
-
Constructor Details
-
SimpleHttpCodeStatusMapper
public SimpleHttpCodeStatusMapper()Create a newSimpleHttpCodeStatusMapper
instance using default mappings. -
SimpleHttpCodeStatusMapper
Create a newSimpleHttpCodeStatusMapper
with the specified mappings.- Parameters:
mappings
- the mappings to use ornull
to use the default mappings
-
-
Method Details
-
getStatusCode
Description copied from interface:HttpCodeStatusMapper
Return the HTTP status code that corresponds to the givenhealth status
.- Specified by:
getStatusCode
in interfaceHttpCodeStatusMapper
- Parameters:
status
- the health status to map- Returns:
- the corresponding HTTP status code
-