brapi-java-client/src/main/java/org/brapi/client/v2/BrAPIClient.java
public List<Pair<String, String>> parameterToPairs(String collectionFormat, String name, Collection value) {
		List<Pair<String, String>> params = new ArrayList<>();

		// preconditions
		if (name == null || name.isEmpty() || value == null || value.isEmpty()) {
			return params;
		}

		// create the params based on the collection format
		if ("multi".equals(collectionFormat)) {
			for (Object item : value) {
				params.add(new ImmutablePair<>(name, escapeString(parameterToString(item))));
			}
			return params;
		}

		// collectionFormat is assumed to be "csv" by default
		String delimiter = ",";

		// escape all delimiters except commas, which are URI reserved
		// characters
		if ("ssv".equals(collectionFormat)) {
			delimiter = escapeString(" ");
		} else if ("tsv".equals(collectionFormat)) {
			delimiter = escapeString("\t");
		} else if ("pipes".equals(collectionFormat)) {
			delimiter = escapeString("|");
		}

		StringBuilder sb = new StringBuilder();
		for (Object item : value) {
			sb.append(delimiter);
			sb.append(escapeString(parameterToString(item)));
		}

		params.add(new ImmutablePair<>(name, sb.substring(delimiter.length())));

		return params;
	}
/**
	 * Formats the specified collection query parameters to a list of {@code Pair}
	 * objects.
	 *
	 * Note that the values of each of the returned Pair objects are
	 * percent-encoded.
	 *
	 * @param collectionFormat The collection format of the parameter.
	 * @param name             The name of the parameter.
	 * @param value            The value of the parameter.
	 * @return A list of {@code Pair} objects.
	 */
Formats the specified collection query parameters to a list of  Pair
objects.

Note that the values of each of the returned Pair objects are
percent-encoded.

@param collectionFormat The collection format of the parameter.
@param name             The name of the parameter.
@param value            The value of the parameter.
@return A list of  Pair objects.
Formats the specified collection query parameters to a list of Pair objects . Note that the values of each of the returned Pair objects are percent - encoded . @param collectionFormat The collection format of the parameter . @param name The name of the parameter . @param value The value of the parameter . @return A list of Pair objects .
public List<Pair<String, String>> parameterToPairs(String collectionFormat, String name, Collection value) {
		List<Pair<String, String>> params = new ArrayList<>();
		if (name == null || name.isEmpty() || value == null || value.isEmpty()) {
			return params;
		}
		if ("multi".equals(collectionFormat)) {
			for (Object item : value) {
				params.add(new ImmutablePair<>(name, escapeString(parameterToString(item))));
			}
			return params;
		}
		String delimiter = ",";
		if ("ssv".equals(collectionFormat)) {
			delimiter = escapeString(" ");
		} else if ("tsv".equals(collectionFormat)) {
			delimiter = escapeString("\t");
		} else if ("pipes".equals(collectionFormat)) {
			delimiter = escapeString("|");
		}
		StringBuilder sb = new StringBuilder();
		for (Object item : value) {
			sb.append(delimiter);
			sb.append(escapeString(parameterToString(item)));
		}
		params.add(new ImmutablePair<>(name, sb.substring(delimiter.length())));
		return params;
	}
public List < Pair < String , String > > parameterToPairs ( String collectionFormat , String name , Collection value ) { List < Pair < String , String > > params = new ArrayList < > ( ) ; if ( name == null || name . isEmpty ( ) || value == null || value . isEmpty ( ) ) { return params ; } if ( "multi" . equals ( collectionFormat ) ) { for ( Object item : value ) { params . add ( new ImmutablePair < > ( name , escapeString ( parameterToString ( item ) ) ) ) ; } return params ; } String delimiter = "," ; if ( "ssv" . equals ( collectionFormat ) ) { delimiter = escapeString ( " " ) ; } else if ( "tsv" . equals ( collectionFormat ) ) { delimiter = escapeString ( "\t" ) ; } else if ( "pipes" . equals ( collectionFormat ) ) { delimiter = escapeString ( "|" ) ; } StringBuilder sb = new StringBuilder ( ) ; for ( Object item : value ) { sb . append ( delimiter ) ; sb . append ( escapeString ( parameterToString ( item ) ) ) ; } params . add ( new ImmutablePair < > ( name , sb . substring ( delimiter . length ( ) ) ) ) ; return params ; }
Formats the specified collection query parameters to a list of {@code Pair}
 objects.
Formats the specified collection query parameters to a list of { @code Pair } objects .
// preconditions // create the params based on the collection format // collectionFormat is assumed to be "csv" by default // escape all delimiters except commas, which are URI reserved // characters