public static String append(final CharSequence url,final Object... params){
  final String baseUrl=url.toString();
  if (params == null || params.length == 0)   return baseUrl;
  if (params.length % 2 != 0)   throw new IllegalArgumentException("Must specify an even number of parameter names/values");
  final StringBuilder result=new StringBuilder(baseUrl);
  addPathSeparator(baseUrl,result);
  addParamPrefix(baseUrl,result);
  addParam(params[0],params[1],result);
  for (int i=2; i < params.length; i+=2) {
    result.append('&');
    addParam(params[i],params[i + 1],result);
  }
  return result.toString();
}

public static String append ( final CharSequence url , final Object ... params ) { final String baseUrl = url . toString ( ) ; if ( params == null || params . length == 0 ) return baseUrl ; if ( params . length % 2 != 0 ) throw new IllegalArgumentException ( "Must specify an even number of parameter names/values" ) ; final StringBuilder result = new StringBuilder ( baseUrl ) ; addPathSeparator ( baseUrl , result ) ; addParamPrefix ( baseUrl , result ) ; addParam ( params [ 0 ] , params [ 1 ] , result ) ; for ( int i = 2 ; i < params . length ; i += 2 ) { result . append ( '&' ) ; addParam ( params [ i ] , params [ i + 1 ] , result ) ; } return result . toString ( ) ; }
append given name / value pairs as query parameters to the base url < p > the params argument is interpreted as a sequence of name / value pairs so the given number of params must be divisible by 2 .
