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

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

    @Override
    public Character convert(String var) {
        if (var == null || var.equals("")) {
            return '0';
        } else {
            return var.charAt(0);
        }
    }

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