code: public int optInt(String key, int defaultValue) {
          final Number val = this.optNumber(key, null);
          if (val == null) {
              return defaultValue;
          }
          return val.intValue();
      }
docs: Get an optional int value associated with a key, or the default if there
  is no such key or if the value is not a number. If the value is a string,
  an attempt will be made to evaluate it as a number.
  
  @param key
  A key string.
  @param defaultValue
  The default.
  @return An object which is the value.