2019年11月22日
摘要: org.apache.commons.lang3.math.NumberUtils 将字符串转换成 int 类型,如果转换失败则返回0或指定的默认值 public static int toInt(final String str) public static int toInt(final Str 阅读全文
posted @ 2019-11-22 11:59 FuYingju 阅读(61) 评论(0) 推荐(0) 编辑
摘要: ObjectUtils org.apache.commons.lang3.ObjectUtils 如果传递的对象是 null,则返回defaultValue public static <T> T defaultIfNull(final T object, final T defaultValue) 阅读全文
posted @ 2019-11-22 11:14 FuYingju 阅读(403) 评论(0) 推荐(0) 编辑
摘要: DateUtils org.apache.commons.lang3.time.DateUtils 判断两个日期是否是同一天 public static boolean isSameDay(final Date date1, final Date date2) 判断两个日期是否在时间上表示同一时刻( 阅读全文
posted @ 2019-11-22 11:13 FuYingju 阅读(188) 评论(0) 推荐(0) 编辑
摘要: org.apache.commons.io.IOUtils 将字节流转换成缓冲字节流 public static InputStream toBufferedInputStream(InputStream input) 将输入流写入字节数组 public static byte[] toByteAr 阅读全文
posted @ 2019-11-22 11:11 FuYingju 阅读(495) 评论(0) 推荐(0) 编辑
摘要: import org.apache.commons.io.FilenameUtils; 测试数据 String fileDirectory = "/D:/aa/bb/cc"; String fileName ="file.txt"; String fileFullName = fileDirecto 阅读全文
posted @ 2019-11-22 11:10 FuYingju 阅读(432) 评论(0) 推荐(0) 编辑
摘要: org.apache.commons.io.FileUtils 创建输入流 public static FileInputStream openInputStream(File file) 说明:openInputStream(file) 与 new FileInputStream(file) 作用 阅读全文
posted @ 2019-11-22 11:09 FuYingju 阅读(234) 评论(0) 推荐(0) 编辑
摘要: org.apache.commons.lang3.ArrayUtils 向数组末尾添加元素 ArrayUtils.add(strs, "str3"); 向数组指定位置添加元素 ArrayUtils.add(strs, 1, "str3"); 向数组中添加所有元素 ArrayUtils.addAll( 阅读全文
posted @ 2019-11-22 11:08 FuYingju 阅读(128) 评论(0) 推荐(0) 编辑
摘要: org.apache.commons.collections.CollectionUtils; 判断集合非空 / 为空 CollectionUtils.isNotEmpty(list); 不会排除null和""。 CollectionUtils.isEmpty(list); 并交差集 List<In 阅读全文
posted @ 2019-11-22 11:08 FuYingju 阅读(87) 评论(0) 推荐(0) 编辑
摘要: org.apache.commons.lang3.StringUtils lang3是Apache Commons 团队发布的工具包,要求jdk版本在1.5以上,相对于 org.apache.commons.lang.StringUtils 来说完全支持java5的特性,废除了一些旧的API。该版本 阅读全文
posted @ 2019-11-22 11:07 FuYingju 阅读(207) 评论(0) 推荐(0) 编辑