会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
花开花落888
Powered by
博客园
博客园
|
首页
|
新随笔
|
联系
|
订阅
|
管理
2020年12月7日
判断字符串是否是数字
摘要: /** * 判断字符串是否是数字 * @param s * @return */ public final static boolean isNumeric(String s) { if (s != null && !"".equals(s.trim())) return s.matches("^[
阅读全文
posted @ 2020-12-07 11:02 superRabbit
阅读(89)
评论(0)
推荐(0)
编辑
判断是否是正确的ip地址
摘要: /** * 判断是否是正确的ip地址 * @param str * @return */ public static boolean isIPAddress(String str) { // 如果长度不符合条件 返回false if (str.length() < 7 || str.length()
阅读全文
posted @ 2020-12-07 10:45 superRabbit
阅读(487)
评论(0)
推荐(0)
编辑
list<entity>转list<map>
摘要: @SuppressWarnings("unchecked") public static <T> List<Map<String, Object>> listConvert(List<T> list) { List<Map<String, Object>> list_map = new ArrayL
阅读全文
posted @ 2020-12-07 10:32 superRabbit
阅读(804)
评论(0)
推荐(0)
编辑
对list分页
摘要: /** * 根据索引对源list进行截取并返回新的list,如果pageSize和pageNum任意一个为null、空字符串 * @param list 源list * @param pageSize 每页数量 * @param pageNum 页数 * @return */ @SuppressWa
阅读全文
posted @ 2020-12-07 10:30 superRabbit
阅读(113)
评论(0)
推荐(0)
编辑
UTC时间与本地时间转换
摘要: /** * UTC时间转成本地时间 * 把带t和z的时间转换成相应的时间格式(对应时区) * @param tzTime 传入的时间(格式为:2016-08-15T16:00:00.000Z) * @param foramt 返回的时间类型 * @return */ public static St
阅读全文
posted @ 2020-12-07 09:26 superRabbit
阅读(587)
评论(0)
推荐(0)
编辑
格式化时间(xx天xx时xx分xx秒)
摘要: /** * 格式化时间(xx天xx时xx分xx秒) * @param mills * @return */ public static String formatTime(long ms) { if (ms == 0) { return ""; } Integer ss = 1000; Intege
阅读全文
posted @ 2020-12-07 09:23 superRabbit
阅读(171)
评论(0)
推荐(0)
编辑
计算两个日期相差的天数
摘要: /** * 计算两个日期相差的天数 * @param date1 * @param date2 * @return */ public static int differentDays(Date date1, Date date2) { Calendar cal1 = Calendar.getIns
阅读全文
posted @ 2020-12-07 09:21 superRabbit
阅读(272)
评论(0)
推荐(0)
编辑