static Map<HardwareResource, Criteria> getHardwareThresholdMap(String hardwareThresholdsString) {
    JSONObject thresholds = new JSONObject(hardwareThresholdsString);
    Map<HardwareResource, Criteria> hardwareThresholdMap = new HashMap<>();
    // All criteria should be satisfied.
    // Future work: if multiple throttling rules under "OR" condition needed, a list of thresholds/hardwareThresholdMap can be used.
    for (HardwareResource hardwareResource : HardwareResource.values()) {
      if (thresholds.has(hardwareResource.name())) {
        String jsonString = thresholds.getJSONObject(hardwareResource.name()).toString();
        ObjectMapper objectMapper = new ObjectMapper();
        try {
          Criteria criteria = objectMapper.readValue(jsonString, Criteria.class);
          hardwareThresholdMap.put(hardwareResource, criteria);
        } catch (IOException e) {
          logger.error("Error while parsing {} threshold ", hardwareResource.name(), e);
          continue;
        }
      }
    }
    return hardwareThresholdMap;
  }
Return a HardwareThresholdMap by parsing input string which in JsonObject format.
@param hardwareThresholdsString hardwareThresholds string.
ambry-commons/src/main/java/com/github/ambry/commons/HostLevelThrottler.java