package io.vertx.core.http.impl;
import io.netty.handler.codec.http.HttpHeaders;
import io.vertx.core.MultiMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class implements MultiMap {
private final HttpHeaders ;
public HeadersAdaptor(HttpHeaders headers) {
this.headers = headers;
}
@Override
public String (String name) {
return headers.get(name);
}
@Override
public List<String> (String name) {
return headers.getAll(name);
}
@Override
public List<Map.Entry<String, String>> () {
return headers.entries();
}
@Override
public boolean (String name) {
return headers.contains(name);
}
@Override
public boolean () {
return headers.isEmpty();
}
@Override
public Set<String> () {
return headers.names();
}
@Override
public MultiMap (String name, String value) {
headers.add(name, value);
return this;
}
@Override
public MultiMap (String name, Iterable<String> values) {
headers.add(name, values);
return this;
}
@Override
public MultiMap (MultiMap headers) {
for (Map.Entry<String, String> entry: headers.entries()) {
add(entry.getKey(), entry.getValue());
}
return this;
}
@Override
public MultiMap (Map<String, String> map) {
for (Map.Entry<String, String> entry: map.entrySet()) {
add(entry.getKey(), entry.getValue());
}
return this;
}
@Override
public MultiMap (String name, String value) {
headers.set(name, value);
return this;
}
@Override
public MultiMap (String name, Iterable<String> values) {
headers.set(name, values);
return this;
}
@Override
public MultiMap (MultiMap httpHeaders) {
clear();
for (Map.Entry<String, String> entry: httpHeaders) {
add(entry.getKey(), entry.getValue());
}
return this;
}
@Override
public MultiMap (String name) {
headers.remove(name);
return this;
}
@Override
public MultiMap () {
headers.clear();
return this;
}
@Override
public Iterator<Map.Entry<String, String>> () {
return headers.iteratorAsString();
}
@Override
public int () {
return names().size();
}
@Override
public MultiMap (Map<String, String> headers) {
for (Map.Entry<String, String> entry: headers.entrySet()) {
add(entry.getKey(), entry.getValue());
}
return this;
}
@Override
public String (CharSequence name) {
return headers.get(name);
}
@Override
public List<String> (CharSequence name) {
return headers.getAll(name);
}
@Override
public boolean (CharSequence name) {
return headers.contains(name);
}
@Override
public boolean (String name, String value, boolean caseInsensitive) {
return headers.contains(name, value, caseInsensitive);
}
@Override
public boolean (CharSequence name, CharSequence value, boolean caseInsensitive) {
return headers.contains(name, value, caseInsensitive);
}
@Override
public MultiMap (CharSequence name, CharSequence value) {
headers.add(name, value);
return this;
}
@Override
public MultiMap (CharSequence name, Iterable<CharSequence> values) {
headers.add(name, values);
return this;
}
@Override
public MultiMap (CharSequence name, CharSequence value) {
headers.set(name, value);
return this;
}
@Override
public MultiMap (CharSequence name, Iterable<CharSequence> values) {
headers.set(name, values);
return this;
}
@Override
public MultiMap (CharSequence name) {
headers.remove(name);
return this;
}
}