package ${basePackage}.frame.excel.converter;

/**
 * ShortConverter - Short转化器，重写了对象到String，String到对象的转化方式
 *
 * @author wangbing
 * @version 0.0.1
 * @since 2017-01-01
 */
public class ShortConverter implements Converter<Short> {

    @Override
    public Short convert(String var) {
        try {
            return Short.parseShort(var);
        } catch (Exception e) {
            return 0;
        }
    }

    @Override
    public String string(Short var) {
        if (var == null) {
            return "";
        }
        return String.valueOf(var);
    }
}
