public int getIntInRange(String name, int defaultVal, int start, int end) {
    int v = containsKey(name) ? Integer.parseInt(getProperty(name)) : defaultVal;
    if (v >= start && v <= end) {
      return v;
    } else {
      throw new IllegalArgumentException(
          name + " has value " + v + " which is not in the range " + start + "-" + end + ".");
    }
  }
Read an integer from the properties instance. Throw an exception
if the value is not in the given range (inclusive)
@param name The property name
@param defaultVal The default value to use if the property is not found
@param start The start of the range in which the value must fall (inclusive)
@param end The end of the range in which the value must fall
@throws IllegalArgumentException If the value is not in the given range
@return the integer value
ambry-api/src/main/java/com/github/ambry/config/VerifiableProperties.java