All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy