package cc.smtweb.framework.core.mvc.controller.binder.param;

public class IntegerEditor extends AbstractNumberEditor {
    private static final Integer INT_ZERO = 0;

    public IntegerEditor(int header, boolean automicType) {
        super(header, automicType);
    }

    @Override
    protected Object convert(Number value) {
        return value.intValue();
    }

    @Override
    protected Object getValue(String text) {
        return Integer.valueOf(text);
    }

    @Override
    protected Object defaultValue() {
        return INT_ZERO;
    }
}
