Looly 5 年 前
コミット
fb46196782

+ 1 - 0
CHANGELOG.md

@@ -19,6 +19,7 @@
 * 【core   】     优化Combination.countAll(pr#1159@Github)
 * 【core   】     优化Combination.countAll(pr#1159@Github)
 * 【core   】     优化针对list的split方法(pr#194@Gitee)
 * 【core   】     优化针对list的split方法(pr#194@Gitee)
 * 【poi    】     ExcelWriter增加setRowStyle方法
 * 【poi    】     ExcelWriter增加setRowStyle方法
+* 【core   】     Assert增加函数接口(pr#1166@Github)
 
 
 ### Bug修复
 ### Bug修复
 * 【core   】     解决农历判断节日未判断大小月导致的问题(issue#I1XHSF@Gitee)
 * 【core   】     解决农历判断节日未判断大小月导致的问题(issue#I1XHSF@Gitee)

ファイルの差分が大きいため隠しています
+ 294 - 291
hutool-core/src/main/java/cn/hutool/core/lang/Assert.java


+ 9 - 0
hutool-core/src/test/java/cn/hutool/core/lang/AssertTest.java

@@ -18,12 +18,21 @@ public class AssertTest {
 	@Test(expected = IllegalArgumentException.class)
 	@Test(expected = IllegalArgumentException.class)
 	public void isTrueTest() {
 	public void isTrueTest() {
 		int i = 0;
 		int i = 0;
+		//noinspection ConstantConditions
 		cn.hutool.core.lang.Assert.isTrue(i > 0, IllegalArgumentException::new);
 		cn.hutool.core.lang.Assert.isTrue(i > 0, IllegalArgumentException::new);
 	}
 	}
 
 
 	@Test(expected = IndexOutOfBoundsException.class)
 	@Test(expected = IndexOutOfBoundsException.class)
 	public void isTrueTest2() {
 	public void isTrueTest2() {
 		int i = -1;
 		int i = -1;
+		//noinspection ConstantConditions
 		cn.hutool.core.lang.Assert.isTrue(i >= 0, IndexOutOfBoundsException::new);
 		cn.hutool.core.lang.Assert.isTrue(i >= 0, IndexOutOfBoundsException::new);
 	}
 	}
+
+	@Test(expected = IndexOutOfBoundsException.class)
+	public void isTrueTest3() {
+		int i = -1;
+		//noinspection ConstantConditions
+		Assert.isTrue(i > 0, ()-> new IndexOutOfBoundsException("relation message to return"));
+	}
 }
 }

+ 3 - 1
hutool-json/src/main/java/cn/hutool/json/JSONNull.java

@@ -1,5 +1,7 @@
 package cn.hutool.json;
 package cn.hutool.json;
 
 
+import cn.hutool.core.util.StrUtil;
+
 import java.io.Serializable;
 import java.io.Serializable;
 
 
 /**
 /**
@@ -39,6 +41,6 @@ public class JSONNull implements Serializable{
 	 */
 	 */
 	@Override
 	@Override
 	public String toString() {
 	public String toString() {
-		return "null";
+		return StrUtil.NULL;
 	}
 	}
 }
 }

+ 6 - 0
hutool-poi/src/test/java/cn/hutool/poi/excel/test/ExcelReadTest.java

@@ -214,4 +214,10 @@ public class ExcelReadTest {
 		reader.read((cell, value)-> Console.log("{}, {} {}", cell.getRowIndex(), cell.getColumnIndex(), value));
 		reader.read((cell, value)-> Console.log("{}, {} {}", cell.getRowIndex(), cell.getColumnIndex(), value));
 	}
 	}
 
 
+	@Test
+	public void readTest() {
+		final ExcelReader reader = ExcelUtil.getReader("d:/test/人员体检信息表.xlsx");
+		final List<List<Object>> read = reader.read();
+//		Console.log(read);
+	}
 }
 }