@Override void apply(RequestBuilder builder, @Nullable T value) throws IOException { if (value == null) return; // Skip null values. builder.addQueryParam(nameConverter.convert(value), null, encoded); } }
@Override void apply(RequestBuilder builder, @Nullable T value) throws IOException { if (value == null) return; // Skip null values. String queryValue = valueConverter.convert(value); if (queryValue == null) return; // Skip converted but null values builder.addQueryParam(name, queryValue, encoded); } }
@Override void apply(RequestBuilder builder, @Nullable T value) throws IOException { if (value == null) return; // Skip null values. builder.addQueryParam(nameConverter.convert(value), null, encoded); } }
@Override void apply(RequestBuilder builder, @Nullable T value) throws IOException { if (value == null) return; // Skip null values. String queryValue = valueConverter.convert(value); if (queryValue == null) return; // Skip converted but null values builder.addQueryParam(name, queryValue, encoded); } }
@Override void apply(RequestBuilder builder, @Nullable Map<String, T> value) throws IOException { if (value == null) { throw Utils.parameterError(method, p, "Query map was null"); } for (Map.Entry<String, T> entry : value.entrySet()) { String entryKey = entry.getKey(); if (entryKey == null) { throw Utils.parameterError(method, p, "Query map contained null key."); } T entryValue = entry.getValue(); if (entryValue == null) { throw Utils.parameterError(method, p, "Query map contained null value for key '" + entryKey + "'."); } String convertedEntryValue = valueConverter.convert(entryValue); if (convertedEntryValue == null) { throw Utils.parameterError(method, p, "Query map value '" + entryValue + "' converted to null by " + valueConverter.getClass().getName() + " for key '" + entryKey + "'."); } builder.addQueryParam(entryKey, convertedEntryValue, encoded); } } }
@Override void apply(RequestBuilder builder, @Nullable Map<String, T> value) throws IOException { if (value == null) { throw new IllegalArgumentException("Query map was null."); } for (Map.Entry<String, T> entry : value.entrySet()) { String entryKey = entry.getKey(); if (entryKey == null) { throw new IllegalArgumentException("Query map contained null key."); } T entryValue = entry.getValue(); if (entryValue == null) { throw new IllegalArgumentException( "Query map contained null value for key '" + entryKey + "'."); } String convertedEntryValue = valueConverter.convert(entryValue); if (convertedEntryValue == null) { throw new IllegalArgumentException("Query map value '" + entryValue + "' converted to null by " + valueConverter.getClass().getName() + " for key '" + entryKey + "'."); } builder.addQueryParam(entryKey, convertedEntryValue, encoded); } } }