code: public int getInt(String key, int defaultValue) {
      Object value = get(key);
      if (value instanceof Integer) {
        return (int) value;
      }
      if (value instanceof Number) {
        return ((Number) value).intValue();
      } else if (value instanceof String) {
        try {
          return Integer.valueOf((String) value);
        } catch (NumberFormatException ignored) {
        }
      }
      return defaultValue;
    }
docs: Returns the value mapped by {@code key} if it exists and is a integer or can be coerced to a
  integer. Returns {@code defaultValue} otherwise.