文章分类 -  java

org.apache.commons.lang3
摘要:背景以及问题 记处理一次sonarqube扫出来的代码问题。 代码 public void main() { try { Thread.sleep(100L); } catch (Exception e) { log.error("err. "e); } } sonar提示问题 Either re- 阅读全文
posted @ 2021-11-29 14:46 正义的五毛 阅读(13895) 评论(0) 推荐(2)
摘要:介绍 compute是java8 Map接口带来的默认接口函数, 其他相关函数computeIfPresent computeIfAbsent compute 源码如下, 1. newValue替换oldValue,返回newValue 2. 如果newValue==null则剔除元素。 //源码 阅读全文
posted @ 2021-09-15 21:24 正义的五毛 阅读(3943) 评论(0) 推荐(0)
摘要:StopWatch 计时器 开始/结束(createStarted) StopWatch stopWatch = StopWatch.createStarted(); stopWatch.stop(); 开始、获取某一时刻、结束 StopWatch stopWatch = new StopWatch 阅读全文
posted @ 2021-08-19 23:22 正义的五毛 阅读(392) 评论(0) 推荐(0)
摘要:简单使用 public class Solution { public static void main(String... arg) { /** * 创建 */ //string BigDecimal bigDecimal = new BigDecimal("1.010"); //int bigD 阅读全文
posted @ 2020-12-16 16:15 正义的五毛 阅读(127) 评论(0) 推荐(0)
摘要:public class Solution { private static Boolean result; public static void main(String... arg) { String str = "13"; //判空 StringUtils.isBlank(str); Stri 阅读全文
posted @ 2020-11-06 11:58 正义的五毛 阅读(193) 评论(0) 推荐(0)
摘要:简单使用 创建 public class Test { public static void main(String... arg) { BitSet bitSet = new BitSet(8); System.out.println(bitSet); //BitSet 中最高设置位的索引加 1 阅读全文
posted @ 2020-10-28 22:52 正义的五毛 阅读(135) 评论(0) 推荐(0)