remove methodsa

This commit is contained in:
Looly
2024-08-21 19:00:09 +08:00
parent c0793d90bb
commit c93d4785d9
3 changed files with 2 additions and 32 deletions

View File

@@ -411,7 +411,7 @@ public class BeanUtilTest {
p2.setName("oldName");
// null值不覆盖目标属性
BeanUtil.copyProperties(p1, p2, CopyOptions.of().ignoreNullValue());
BeanUtil.copyProperties(p1, p2, CopyOptions.of().setIgnoreNullValue(true));
assertEquals("oldName", p2.getName());
// null覆盖目标属性

View File

@@ -30,7 +30,7 @@ public class BeanCopierTest {
Assertions.assertNull(map.get("value"));
// 忽略null的情况下空字段不写入map
map = BeanCopier.of(a, new HashMap<>(), CopyOptions.of().ignoreNullValue()).copy();
map = BeanCopier.of(a, new HashMap<>(), CopyOptions.of().setIgnoreNullValue(true)).copy();
Assertions.assertFalse(map.containsKey("value"));
Assertions.assertEquals(0, map.size());
}