add methods

This commit is contained in:
Looly
2022-04-06 09:46:44 +08:00
parent 04612516d4
commit 58c7c688ae
5 changed files with 36 additions and 29 deletions

View File

@@ -564,11 +564,13 @@ public class BeanUtilTest {
@Test
public void copyBeanPropertiesFunctionFilterTest() {
//https://gitee.com/dromara/hutool/pulls/590
Person o = new Person();
o.setName("asd");
o.setAge(123);
o.setOpenid("asd");
@SuppressWarnings("unchecked")
CopyOptions copyOptions = CopyOptions.create().setIgnoreProperties(Person::getAge,Person::getOpenid);
Person n = new Person();
BeanUtil.copyProperties(o, n, copyOptions);