@SuppressWarnings("unchecked")
  public @NotNull QueryStringBuilder param(@NotNull String name, @Nullable Object value) {
    if (value instanceof Iterable) {
      Iterable<Object> valueItems = (Iterable)value;
      for (Object valueItem : valueItems) {
        params.add(new NameValuePair(name, valueItem));
      }
    }
    else if (isArray(value)) {
      int length = Array.getLength(value);
      for (int i = 0; i < length; i++) {
        Object valueItem = Array.get(value, i);
        params.add(new NameValuePair(name, valueItem));
      }
    }
    else {
      params.add(new NameValuePair(name, value));
    }
    return this;
  }
@ SuppressWarnings ( "unchecked" ) public @ NotNull QueryStringBuilder param ( @ NotNull String name , @ Nullable Object value ) { if ( value instanceof Iterable ) { Iterable < Object > valueItems = ( Iterable ) value ; for ( Object valueItem : valueItems ) { params . add ( new NameValuePair ( name , valueItem ) ) ; } } else if ( isArray ( value ) ) { int length = Array . getLength ( value ) ; for ( int i = 0 ; i < length ; i ++ ) { Object valueItem = Array . get ( value , i ) ; params . add ( new NameValuePair ( name , valueItem ) ) ; } } else { params . add ( new NameValuePair ( name , value ) ) ; } return this ; }
Add parameter to query string.
@param name Parameter name
@param value Parameter value. Will be converted to string.
If value is an array or {@link Iterable} the value items will be added as separate parameters.
@return this