@Override public DefaultSdkHttpFullRequest.Builder headers(Map<String, List<String>> headers) { this.headers = CollectionUtils.deepCopyMap(headers); return this; }
@Override public DefaultSdkHttpFullRequest.Builder headers(Map<String, List<String>> headers) { this.headers = CollectionUtils.deepCopyMap(headers); return this; }
private Builder(DefaultSdkHttpFullResponse defaultSdkHttpFullResponse) { this.statusText = defaultSdkHttpFullResponse.statusText; this.statusCode = defaultSdkHttpFullResponse.statusCode; this.content = defaultSdkHttpFullResponse.content; this.headers = CollectionUtils.deepCopyMap(defaultSdkHttpFullResponse.headers); }
private Builder(DefaultSdkHttpFullResponse defaultSdkHttpFullResponse) { this.statusText = defaultSdkHttpFullResponse.statusText; this.statusCode = defaultSdkHttpFullResponse.statusCode; this.content = defaultSdkHttpFullResponse.content; this.headers = CollectionUtils.deepCopyMap(defaultSdkHttpFullResponse.headers); }
@Override @SuppressWarnings("unchecked") public B headers(Map<String, List<String>> headers) { Validate.paramNotNull(headers, "headers"); this.headers = CollectionUtils.deepCopyMap(headers); return (B) this; }
@Override public Builder headers(Map<String, List<String>> headers) { Validate.paramNotNull(headers, "headers"); this.headers = CollectionUtils.deepCopyMap(headers); return this; }
@Override public DefaultSdkHttpFullRequest.Builder rawQueryParameters(Map<String, List<String>> queryParameters) { this.queryParameters = CollectionUtils.deepCopyMap(queryParameters, () -> new LinkedHashMap<>()); return this; }
@Override @SuppressWarnings("unchecked") public B rawQueryParameters(Map<String, List<String>> rawQueryParameters) { Validate.paramNotNull(rawQueryParameters, "rawQueryParameters"); this.rawQueryParameters = CollectionUtils.deepCopyMap(rawQueryParameters); return (B) this; }
@Override public Builder headers(Map<String, List<String>> headers) { Validate.paramNotNull(headers, "headers"); this.headers = CollectionUtils.deepCopyMap(headers); return this; }
/** * Perform a deep copy of the provided map of lists. This only performs a deep copy of the map and lists. Entries are not * copied, so care should be taken to ensure that entries are immutable if preventing unwanted mutations of the elements is * desired. */ public static <T, U> Map<T, List<U>> deepCopyMap(Map<T, ? extends List<U>> map) { return deepCopyMap(map, () -> new HashMap<>()); }
/** * Perform a deep copy of the provided map of lists. This only performs a deep copy of the map and lists. Entries are not * copied, so care should be taken to ensure that entries are immutable if preventing unwanted mutations of the elements is * desired. */ public static <T, U> Map<T, List<U>> deepCopyMap(Map<T, ? extends List<U>> map) { return deepCopyMap(map, () -> new HashMap<>()); }
@Override public DefaultSdkHttpFullRequest.Builder rawQueryParameters(Map<String, List<String>> queryParameters) { this.queryParameters = CollectionUtils.deepCopyMap(queryParameters, () -> new LinkedHashMap<>()); return this; }
@Override public Builder headers(Map<String, List<String>> headers) { Validate.paramNotNull(headers, "headers"); this.headers = CollectionUtils.deepCopyMap(headers, () -> new TreeMap<>(String.CASE_INSENSITIVE_ORDER)); return this; }