package org.springframework.http;
import java.util.AbstractMap.SimpleImmutableEntry;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.springframework.lang.Nullable;
import org.springframework.util.MultiValueMap;
class extends HttpHeaders {
private static final long = -8578554704772377436L;
@Nullable
private MediaType ;
@Nullable
private List<MediaType> ;
(MultiValueMap<String, String> headers) {
super(headers);
}
@Override
public MediaType () {
if (this.cachedContentType != null) {
return this.cachedContentType;
}
else {
MediaType contentType = super.getContentType();
this.cachedContentType = contentType;
return contentType;
}
}
@Override
public List<MediaType> () {
if (this.cachedAccept != null) {
return this.cachedAccept;
}
else {
List<MediaType> accept = super.getAccept();
this.cachedAccept = accept;
return accept;
}
}
@Override
public void () {
}
@Override
public List<String> (Object key) {
List<String> values = this.headers.get(key);
return (values != null ? Collections.unmodifiableList(values) : null);
}
@Override
public void (String headerName, @Nullable String headerValue) {
throw new UnsupportedOperationException();
}
@Override
public void (String key, List<? extends String> values) {
throw new UnsupportedOperationException();
}
@Override
public void (MultiValueMap<String, String> values) {
throw new UnsupportedOperationException();
}
@Override
public void (String headerName, @Nullable String headerValue) {
throw new UnsupportedOperationException();
}
@Override
public void (Map<String, String> values) {
throw new UnsupportedOperationException();
}
@Override
public Map<String, String> () {
return Collections.unmodifiableMap(this.headers.toSingleValueMap());
}
@Override
public Set<String> () {
return Collections.unmodifiableSet(this.headers.keySet());
}
@Override
public List<String> (String key, List<String> value) {
throw new UnsupportedOperationException();
}
@Override
public List<String> (Object key) {
throw new UnsupportedOperationException();
}
@Override
public void (Map<? extends String, ? extends List<String>> map) {
throw new UnsupportedOperationException();
}
@Override
public void () {
throw new UnsupportedOperationException();
}
@Override
public Collection<List<String>> () {
return Collections.unmodifiableCollection(this.headers.values());
}
@Override
public Set<Entry<String, List<String>>> () {
return this.headers.entrySet().stream().map(SimpleImmutableEntry::new)
.collect(Collectors.collectingAndThen(
Collectors.toCollection(LinkedHashSet::new),
Collections::unmodifiableSet));
}
}