package io.vertx.ext.web.impl;
import io.vertx.ext.web.LanguageHeader;
import io.vertx.ext.web.MIMEHeader;
import io.vertx.ext.web.ParsedHeaderValue;
import io.vertx.ext.web.ParsedHeaderValues;
import java.util.Collection;
import java.util.List;
public class implements ParsedHeaderValues {
private final List<MIMEHeader> ;
private final List<ParsedHeaderValue> ;
private final List<ParsedHeaderValue> ;
private final List<LanguageHeader> ;
private final ParsableMIMEValue ;
public (
List<MIMEHeader> accept, List<ParsedHeaderValue> acceptCharset, List<ParsedHeaderValue> acceptEncoding,
List<LanguageHeader> acceptLanguage, ParsableMIMEValue contentType) {
this.accept = accept;
this.acceptCharset = acceptCharset;
this.acceptEncoding = acceptEncoding;
this.acceptLanguage = acceptLanguage;
this.contentType = contentType;
}
@Override
public List<MIMEHeader> () {
return accept;
}
@Override
public List<ParsedHeaderValue> () {
return acceptCharset;
}
@Override
public List<ParsedHeaderValue> () {
return acceptEncoding;
}
@Override
public List<LanguageHeader> () {
return acceptLanguage;
}
@Override
public ParsableMIMEValue () {
return contentType;
}
@Override
public MIMEHeader (List<MIMEHeader> userAccepted, Collection<MIMEHeader> in) {
for (MIMEHeader acceptableType: userAccepted) {
MIMEHeader acceptedType = acceptableType.findMatchedBy(in);
if (acceptedType != null) {
if ("*".equals(acceptedType.subComponent()) || "*".equals(acceptedType.component()))
return acceptableType;
else
return acceptedType;
}
}
return null;
}
}