org.zodiac.netty.http.headers.IntHeader Maven / Gradle / Ivy
package org.zodiac.netty.http.headers;
import java.util.Objects;
import org.zodiac.sdk.toolkit.util.lang.NumUtil;
class IntHeader extends AbstractHeader {
IntHeader(CharSequence name) {
super(Integer.TYPE, name);
}
@Override
public CharSequence toCharSequence(Integer value) {
return Objects.requireNonNull(value, "value").toString();
}
@Override
public Integer toValue(CharSequence value) {
return NumUtil.parseInt(Objects.requireNonNull(value, "value"));
}
}