Interface HttpCodeStatusMapper
- All Known Implementing Classes:
SimpleHttpCodeStatusMapper
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Strategy used to map a
health status to an HTTP status code.- Since:
- 4.0.0
- Author:
- Stephane Nicoll, Phillip Webb
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HttpCodeStatusMapperDeprecated, for removal: This API element is subject to removal in a future version.since 4.1.0 for removal in 4.3.0 in favor of #getDefault() -
Method Summary
Modifier and TypeMethodDescriptionstatic HttpCodeStatusMapperReturn anHttpCodeStatusMapperinstance using default mappings.intgetStatusCode(Status status) Return the HTTP status code that corresponds to the givenhealth status.static HttpCodeStatusMapperCreate a newHttpCodeStatusMapperwith the specified mappings.
-
Field Details
-
DEFAULT
Deprecated, for removal: This API element is subject to removal in a future version.since 4.1.0 for removal in 4.3.0 in favor of #getDefault()AnHttpCodeStatusMapperinstance using default mappings.
-
-
Method Details
-
getStatusCode
Return the HTTP status code that corresponds to the givenhealth status.- Parameters:
status- the health status to map- Returns:
- the corresponding HTTP status code
-
of
Create a newHttpCodeStatusMapperwith the specified mappings.- Parameters:
mappings- the mappings to use ornullto use the default mappings- Returns:
- a
HttpCodeStatusMapperorgetDefault() - Since:
- 4.1.0
-
getDefault
Return anHttpCodeStatusMapperinstance using default mappings.- Returns:
- a mapper using default mappings
- Since:
- 4.1.0
-