Your Name
2023-02-05 b3064052c54fa095ea0b597871f003a97c3f4c99
java110-utils/src/main/java/com/java110/utils/util/Java110StringConvert.java
old mode 100644 new mode 100755
@@ -35,6 +35,8 @@
    @Override
    protected String convertToString(Object value) throws Throwable {
        logger.debug("convertToString当前对象类型start" + value.getClass());
        if (value instanceof Date) {
            return DateUtil.getFormatTimeString((Date) value, DateUtil.DATE_FORMATE_STRING_A);
        }
@@ -43,17 +45,23 @@
    }
    @Override
    protected Object convertToType(Class type, Object value) throws Throwable {
    protected <T> T convertToType(Class<T> type, Object value) throws Throwable {
        //System.out.printf("12313");
        if (value instanceof Date) {
            return DateUtil.getFormatTimeString((Date) value, DateUtil.DATE_FORMATE_STRING_A);
        logger.debug("convertToType当前对象类型start" + value.getClass());
        if(type.getClass().equals(String.class)) {
           if (value instanceof Date) {
               return type.cast(DateUtil.getFormatTimeString(Date.class.cast(value), DateUtil.DATE_FORMATE_STRING_A));
           }
           logger.debug("convertToType当前对象类型" + value.getClass());
           return type.cast(value.toString());
        }else {
           return null;
        }
        logger.debug("convertToType当前对象类型" + value.getClass());
        return value.toString();
    }
    @Override
    protected Class getDefaultType() {
    protected Class<?> getDefaultType() {
        return String.class;
    }
}