JSON.parseObject(String str,Object.Class o),是将Json字符串转化为相应的对象;
JSON.toJSONString(Object o)则是将对象转化为Json字符串。
BigDecimal.floatValue():将BigDecimal型数据转换成float型
DateUtil.format(new Date(entMemberDepositDO.getExpireDate()), “yyyy/MM/dd HH:mm:ss”) // entMemberDepositDO.getExpireDate()是一个时间戳
/*** 根据特定格式格式化日期** @param date 被格式化的日期* @param format 日期格式,常用格式见: {@link DatePattern}* @return 格式化后的字符串*/public static String format(Date date, String format) {if (null == date || StrUtil.isBlank(format)) {return null;}final SimpleDateFormat sdf = new SimpleDateFormat(format);if (date instanceof DateTime) {final TimeZone timeZone = ((DateTime) date).getTimeZone();if (null != timeZone) {sdf.setTimeZone(timeZone);}}return format(date, sdf);}
Hutool
- DatePattern:日期格式化类,提供常用的日期格式化对象
- NumberUtil:Hutool中操作数字类型的工具包
- StrUtil:Hutool中操作字符串类型的工具包
- BeanUtil:Bean工具类。
