code: public String encode(Object value) throws UnsupportedEncodingException {
          if (value == null) {
              return null;
          }
  
          return URLEncoder.encode(value.toString(), encoding);
      }
docs: Encodes given value with a proper encoding. This is a convenient method for primitive, plain data types. Value will not be converted to JSON. Note: Value
  can be null.
  
  @param value value to be encoded
  @return String encoded value
  @throws UnsupportedEncodingException DOCUMENT_ME