摘要: RandomStringUtils 类全路径: org.apache.commons.lang3.RandomStringUtils 用所有支持的字符生成随机字符串 例如生成长度为10的随机字符串: System.out.print(RandomStringUtils.random(10)); 用英 阅读全文
posted @ 2021-04-21 18:19 _YMW 阅读(783) 评论(0) 推荐(0) 编辑
摘要: RandomUtils 类全路径: org.apache.commons.lang3.RandomUtils 生成随机 boolean 值: System.out.print(RandomUtils.nextBoolean()); 生成随机 int 数: 随机数的取数范围是[0, Integer.M 阅读全文
posted @ 2021-04-21 17:43 _YMW 阅读(2022) 评论(0) 推荐(0) 编辑
摘要: 官网 给出了 maven 的依赖导入方式: <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.8.1</version> </dependency> 阅读全文
posted @ 2021-04-21 17:25 _YMW 阅读(7484) 评论(0) 推荐(2) 编辑
摘要: 导包路径:org.apache.commons.lang3 引入 commons-lang3 依赖 RandomUtils 随机数工具类 RandomStringUtils 随机字符串工具类 SerializationUtils 序列化工具类 StringUtils 字符串工具类 StringUti 阅读全文
posted @ 2021-04-21 17:21 _YMW 阅读(514) 评论(0) 推荐(1) 编辑
摘要: StreamStream(流)是一个来自数据源的元素队列并支持聚合操作;mapmap 方法用于映射每个元素到对应的结果;CollectorsCollectors 类实现了很多归约操作,例如将流转换成集合和聚合元素。Collectors 可用于返回列表或字符串。 使用方式: 1.首先创建一个实体类,添 阅读全文
posted @ 2021-04-21 16:50 _YMW 阅读(8132) 评论(0) 推荐(0) 编辑