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
-
Method Summary
Modifier and TypeMethodDescriptionstatic StatusMapperReturn anStatusMapperinstance using default mappings.io.grpc.health.v1.HealthCheckResponse.ServingStatusgetServingStatus(org.springframework.boot.health.contributor.Status status) Return the gRPC serving status that corresponds to the givenhealth status.static StatusMapperCreate a newStatusMapperwith the specified mappings.
-
Method Details
-
getServingStatus
io.grpc.health.v1.HealthCheckResponse.ServingStatus getServingStatus(org.springframework.boot.health.contributor.Status status) Return the gRPC serving status that corresponds to the givenhealth status.- Parameters:
status- the health status to map- Returns:
- the corresponding gRPC serving status
-
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
-