public static Character getChar(Object obj) {
        if (obj == null) {
            return null;
        }
        if (obj instanceof Character) {
            return (Character) obj;
        }
        if (obj instanceof String) {
            return String.valueOf(obj).charAt(0);
        }
        throw new RuntimeException("not support type of " + obj.getClass() + " convert to Char");
    }
Convert val to specified numeric type
Date: 2017/4/21
Company: www.dtstack.com
@author xuchao
core/src/main/java/com/dtstack/flink/sql/util/MathUtil.java