Class SimpleHttpCodeStatusMapper

java.lang.Object
org.springframework.boot.actuate.health.SimpleHttpCodeStatusMapper
All Implemented Interfaces:
HttpCodeStatusMapper

public class SimpleHttpCodeStatusMapper extends Object implements HttpCodeStatusMapper
Simple HttpCodeStatusMapper backed by map of status code to HTTP status code.
Since:
2.2.0
  • Constructor Details

    • SimpleHttpCodeStatusMapper

      public SimpleHttpCodeStatusMapper()
      Create a new SimpleHttpCodeStatusMapper instance using default mappings.
    • SimpleHttpCodeStatusMapper

      public SimpleHttpCodeStatusMapper(@Nullable Map<String,Integer> mappings)
      Create a new SimpleHttpCodeStatusMapper with the specified mappings.
      Parameters:
      mappings - the mappings to use or null to use the default mappings
  • Method Details

    • getStatusCode

      public int getStatusCode(org.springframework.boot.health.contributor.Status status)
      Description copied from interface: HttpCodeStatusMapper
      Return the HTTP status code that corresponds to the given health status.
      Specified by:
      getStatusCode in interface HttpCodeStatusMapper
      Parameters:
      status - the health status to map
      Returns:
      the corresponding HTTP status code