private String createKeyValuePair(Entry<String, Object> entry, Charset charset) {
    String encodedKey = encode(entry.getKey(), charset);
    Object value = entry.getValue();

    if (value == null) {
      return encodedKey;
    } else if (value.getClass().isArray()) {
      return createKeyValuePairFromArray(encodedKey, value, charset);
    } else if (value instanceof Collection) {
      return createKeyValuePairFromCollection(encodedKey, value, charset);
    }
    return new StringBuilder()
        .append(encodedKey)
        .append(EQUAL_SIGN)
        .append(encode(value, charset))
        .toString();
  }
An URL encoded form content processor.

@author Artem Labazin
form/src/main/java/feign/form/UrlencodedFormContentProcessor.java