mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix code
This commit is contained in:
parent
a547909d5e
commit
da4c1d3bf7
@ -45,10 +45,7 @@ import java.util.function.Supplier;
|
|||||||
* .with(Box::alis)
|
* .with(Box::alis)
|
||||||
* .build();
|
* .build();
|
||||||
* </pre>
|
* </pre>
|
||||||
* <p>注意:本工具类支持调用的方法的参数数量不超过5个,更多的参数不利于阅读和维护。
|
* <p>注意:本工具类支持调用的方法的参数数量不超过1个,更多的参数不利于阅读和维护。</p>
|
||||||
* 关于Java方法的参数个数限制似乎并没有明确统一的规范,网络上众说纷纭,这里取个相对平均的数5。
|
|
||||||
* 特殊需要求可以基于此类进行拓展.
|
|
||||||
* </p>
|
|
||||||
*
|
*
|
||||||
* @author TomXin
|
* @author TomXin
|
||||||
* @since 5.7.21
|
* @since 5.7.21
|
||||||
|
@ -32,6 +32,7 @@ public class GenericBuilderTest {
|
|||||||
Assert.assertEquals(8, box.getWidth().intValue());
|
Assert.assertEquals(8, box.getWidth().intValue());
|
||||||
Assert.assertEquals(7, box.getHeight().intValue());
|
Assert.assertEquals(7, box.getHeight().intValue());
|
||||||
|
|
||||||
|
// 对象修改
|
||||||
Box boxModified = GenericBuilder
|
Box boxModified = GenericBuilder
|
||||||
.of(() -> box)
|
.of(() -> box)
|
||||||
.with(Box::setTitle, "Hello Friend!")
|
.with(Box::setTitle, "Hello Friend!")
|
||||||
@ -46,6 +47,7 @@ public class GenericBuilderTest {
|
|||||||
Assert.assertEquals(4, boxModified.getWidth().intValue());
|
Assert.assertEquals(4, boxModified.getWidth().intValue());
|
||||||
Assert.assertEquals(5, boxModified.getHeight().intValue());
|
Assert.assertEquals(5, boxModified.getHeight().intValue());
|
||||||
|
|
||||||
|
// 多参数构造
|
||||||
Box box1 = GenericBuilder
|
Box box1 = GenericBuilder
|
||||||
.of(Box::new, 2048L, "Hello Partner!", 222, 333, 444)
|
.of(Box::new, 2048L, "Hello Partner!", 222, 333, 444)
|
||||||
.with(Box::alis)
|
.with(Box::alis)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user