brapi-java-client/src/main/java/org/brapi/client/v2/BrAPIClient.java
public String buildUrl(String path, Map<String, String> queryParams, Map<String, String> collectionQueryParams) {
		final StringBuilder url = new StringBuilder();
		url.append(basePath).append(path);

		if (queryParams != null && !queryParams.isEmpty()) {
			// support (constant) query string in `path`, e.g. "/posts?draft=1"
			String prefix = path.contains("?") ? "&" : "?";
			for (Entry<String, String> param : queryParams.entrySet()) {
				if (param.getValue() != null) {
					if (prefix != null) {
						url.append(prefix);
						prefix = null;
					} else {
						url.append("&");
					}
					String value = parameterToString(param.getValue());
					url.append(escapeString(param.getKey())).append("=").append(escapeString(value));
				}
			}
		}

		if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) {
			String prefix = url.toString().contains("?") ? "&" : "?";
			for (Entry<String, String> param  : collectionQueryParams.entrySet()) {
				if (param.getValue() != null) {
					if (prefix != null) {
						url.append(prefix);
						prefix = null;
					} else {
						url.append("&");
					}
					String value = parameterToString(param.getValue());
					// collection query parameter value already escaped as part of parameterToPairs
					url.append(escapeString(param.getKey())).append("=").append(value);
				}
			}
		}

		return url.toString();
	}
/**
	 * Build full URL by concatenating base path, the given sub path and query
	 * parameters.
	 *
	 * @param path                  The sub path
	 * @param queryParams           The query parameters
	 * @param collectionQueryParams The collection query parameters
	 * @return The full URL
	 */
Build full URL by concatenating base path, the given sub path and query
parameters.

@param path                  The sub path
@param queryParams           The query parameters
@param collectionQueryParams The collection query parameters
@return The full URL
Build full URL by concatenating base path the given sub path and query parameters . @param path The sub path @param queryParams The query parameters @param collectionQueryParams The collection query parameters @return The full URL
public String buildUrl(String path, Map<String, String> queryParams, Map<String, String> collectionQueryParams) {
		final StringBuilder url = new StringBuilder();
		url.append(basePath).append(path);
		if (queryParams != null && !queryParams.isEmpty()) {
			String prefix = path.contains("?") ? "&" : "?";
			for (Entry<String, String> param : queryParams.entrySet()) {
				if (param.getValue() != null) {
					if (prefix != null) {
						url.append(prefix);
						prefix = null;
					} else {
						url.append("&");
					}
					String value = parameterToString(param.getValue());
					url.append(escapeString(param.getKey())).append("=").append(escapeString(value));
				}
			}
		}
		if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) {
			String prefix = url.toString().contains("?") ? "&" : "?";
			for (Entry<String, String> param  : collectionQueryParams.entrySet()) {
				if (param.getValue() != null) {
					if (prefix != null) {
						url.append(prefix);
						prefix = null;
					} else {
						url.append("&");
					}
					String value = parameterToString(param.getValue());
					url.append(escapeString(param.getKey())).append("=").append(value);
				}
			}
		}
		return url.toString();
	}
public String buildUrl ( String path , Map < String , String > queryParams , Map < String , String > collectionQueryParams ) { final StringBuilder url = new StringBuilder ( ) ; url . append ( basePath ) . append ( path ) ; if ( queryParams != null && ! queryParams . isEmpty ( ) ) { String prefix = path . contains ( "?" ) ? "&" : "?" ; for ( Entry < String , String > param : queryParams . entrySet ( ) ) { if ( param . getValue ( ) != null ) { if ( prefix != null ) { url . append ( prefix ) ; prefix = null ; } else { url . append ( "&" ) ; } String value = parameterToString ( param . getValue ( ) ) ; url . append ( escapeString ( param . getKey ( ) ) ) . append ( "=" ) . append ( escapeString ( value ) ) ; } } } if ( collectionQueryParams != null && ! collectionQueryParams . isEmpty ( ) ) { String prefix = url . toString ( ) . contains ( "?" ) ? "&" : "?" ; for ( Entry < String , String > param : collectionQueryParams . entrySet ( ) ) { if ( param . getValue ( ) != null ) { if ( prefix != null ) { url . append ( prefix ) ; prefix = null ; } else { url . append ( "&" ) ; } String value = parameterToString ( param . getValue ( ) ) ; url . append ( escapeString ( param . getKey ( ) ) ) . append ( "=" ) . append ( value ) ; } } } return url . toString ( ) ; }
Build full URL by concatenating base path, the given sub path and query
 parameters.
Build full URL by concatenating base path the given sub path and query parameters .
// support (constant) query string in `path`, e.g. "/posts?draft=1" // collection query parameter value already escaped as part of parameterToPairs