I am working on a logic to copy properties from one bean to another bean in Java. I used BeanUtils to copy the properties and it works perfectly. Issue is that I want to ignore few properties of nested object but BeanUtils ignore properties work for only top level properties. Is there any util or library to do that ? This is how my code is
class A{
private String name;
private List<B> bArr;
}
Class B {
int age;
int taxID;
}
So I want to hide taxID from list of bArr. Is there a way to do this?
you can use modelmapper and config as you want!!
you have several ways to configure it
<dependency>
<groupId>org.modelmapper</groupId>
<artifactId>modelmapper</artifactId>
<version>2.3.5</version>
</dependency>
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments