This commit is contained in:
Looly
2022-02-07 17:03:05 +08:00
parent a547909d5e
commit da4c1d3bf7
2 changed files with 3 additions and 4 deletions

View File

@@ -32,6 +32,7 @@ public class GenericBuilderTest {
Assert.assertEquals(8, box.getWidth().intValue());
Assert.assertEquals(7, box.getHeight().intValue());
// 对象修改
Box boxModified = GenericBuilder
.of(() -> box)
.with(Box::setTitle, "Hello Friend!")
@@ -46,6 +47,7 @@ public class GenericBuilderTest {
Assert.assertEquals(4, boxModified.getWidth().intValue());
Assert.assertEquals(5, boxModified.getHeight().intValue());
// 多参数构造
Box box1 = GenericBuilder
.of(Box::new, 2048L, "Hello Partner!", 222, 333, 444)
.with(Box::alis)