
org.zalando.logbook.Headers Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of logbook-api Show documentation
Show all versions of logbook-api Show documentation
HTTP request and response logging
package org.zalando.logbook;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import static java.lang.String.CASE_INSENSITIVE_ORDER;
import static java.util.Collections.unmodifiableList;
import static java.util.Collections.unmodifiableMap;
public final class Headers {
private Headers() {
}
public static Map> empty() {
return new TreeMap<>(CASE_INSENSITIVE_ORDER);
}
public static Map> immutableCopy(final Map> headers) {
final Map> copy = empty();
headers.forEach((header, values) ->
copy.put(header, unmodifiableList(new ArrayList<>(values))));
return unmodifiableMap(copy);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy