Interface StatusMapper
- 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 a gRPC HealthCheckResponse.ServingStatus.- Since:
- 4.1.0
- Author:
- Phillip Webb
-
Method Summary
Modifier and TypeMethodDescriptionstatic StatusMapperReturn anStatusMapperinstance using default mappings.io.grpc.health.v1.HealthCheckResponse.ServingStatusgetServingStatus(Status status) Return the HTTP status code that corresponds to the givenhealth status.static StatusMapperCreate a newStatusMapperwith the specified mappings.
-
Method Details
-
getServingStatus
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
static StatusMapper of(@Nullable Map<String, io.grpc.health.v1.HealthCheckResponse.ServingStatus> mappings) Create a newStatusMapperwith the specified mappings.- Parameters:
mappings- the mappings to use ornullto use the default mappings- Returns:
- a
StatusMapperorgetDefault()
-
getDefault
Return anStatusMapperinstance using default mappings.- Returns:
- a mapper using default mappings
-