Quantcast
Channel: JetBrains Developer Community : All Content - IntelliJ IDEA Users
Viewing all articles
Browse latest Browse all 5481

IntelliJ IDEA shortcuts/workflow for populate fields from one object to another

$
0
0

There area lot of classes in my codebase that have an object passed into its constructor to populate its fields from that object's fields like the following:


public class PersonDataHolder {    private String name;    private int age;    public PersonDataHolder(Person person) {        this.name = person.getName();        this.age = person.getAge();    }
}

 

Instead of creating this by hand each time, is there an IDEA shortcut/workflow that makes writing these classes more efficiently?


Viewing all articles
Browse latest Browse all 5481

Trending Articles