org.zodiac.netty.http.headers.BasicCredentialsHeader Maven / Gradle / Ivy
package org.zodiac.netty.http.headers;
import java.util.Objects;
import org.zodiac.commons.http.entities.BasicCredentials;
import io.netty.handler.codec.http.HttpHeaderNames;
class BasicCredentialsHeader extends AbstractHeader {
BasicCredentialsHeader() {
super(BasicCredentials.class, HttpHeaderNames.AUTHORIZATION);
}
@Override
public String toString(BasicCredentials value) {
return Objects.requireNonNull(value, "value").toString();
}
@Override
public BasicCredentials toValue(CharSequence value) {
return BasicCredentials.parse(Objects.requireNonNull(value, "value"));
}
}