class DateUtil {

    public static final String DATE = "yyyy-MM-dd";

    public static final String DATE_TIME = "yyyy-MM-dd HH:mm:ss";

    public static String getSimpleFormatDateTime(Date date) {
        return getFormatDate(date, DATE_TIME);
    }

    public static String getSimpleFormatDate(Date date) {
        return getFormatDate(date, DATE);
    }

    public static String getFormatDate(Date date, String formatStr) {
        SimpleDateFormat sdf = new SimpleDateFormat(formatStr);
        return sdf.format(date);
    }

    @SneakyThrows
    public static Object getDate(Class<?> targetDateType, String str) {<FILL_FUNCTION_BODY>}

}

        if (targetDateType == Date.class) {
            if (str.length() == 10) {
                return new SimpleDateFormat(DATE).parse(str);
            } else {
                return new SimpleDateFormat(DATE_TIME).parse(str);
            }
        } else if (targetDateType == LocalDate.class) {
            return LocalDate.parse(str, DateTimeFormatter.ofPattern(DATE));
        } else if (targetDateType == LocalDateTime.class) {
            return LocalDateTime.parse(str, DateTimeFormatter.ofPattern(DATE_TIME));
        } else {
            throw new EruptWebApiRuntimeException("Unsupported date type");
        }
    
<no_super_class>