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

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

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

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