org.zodiac.netty.http.headers.LocaleHeader Maven / Gradle / Ivy
package org.zodiac.netty.http.headers;
import java.util.Locale;
import java.util.Objects;
class LocaleHeader extends AbstractHeader {
LocaleHeader(CharSequence name) {
super(Locale.class, name);
}
@Override
public String toString(Locale value) {
return Objects.requireNonNull(value, "value").toLanguageTag();
}
@Override
public Locale toValue(CharSequence value) {
return Locale.forLanguageTag(Objects.requireNonNull(value, "value").toString());
}
}