org.zodiac.netty.http.headers.NumberHeader Maven / Gradle / Ivy
package org.zodiac.netty.http.headers;
import org.zodiac.sdk.toolkit.util.lang.NumUtil;
/**
* Header which is a number (so casting to long is unneeded for literals).
*
*/
class NumberHeader extends AbstractHeader {
NumberHeader(CharSequence name) {
super(Number.class, name);
}
@Override
public String toString(Number value) {
return Long.toString(value.longValue());
}
@Override
public Number toValue(CharSequence value) {
return NumUtil.parseLong(value);
}
}