Many times I'm faced with a class which constructor method must contain list of arguments that is identical with the list of class instance variables.
As you see in the example there is "SOME" code to make this hapend. I'm wondering how can I make this process less painful?
Example:
public class VimeoUser extends Schema {
@Getter @Setter private String uri;
@Getter @Setter private String name;
@Getter @Setter private String link;
@Getter @Setter private String location;
@Getter @Setter private String bio;
@Getter @Setter private String createdTime;
@Getter @Setter private String account;
@Getter @Setter private Map<String,Integer> statistics = new HashMap<>();
@Getter @Setter private List<Website> websites = new ArrayList<>();
@Getter @Setter private List<Portrait> portraits = new ArrayList<>();
public VimeoUser(
String uri,
String name,
String link,
String location,
String bio,
String createdTime,
String account,
Map<String,Integer> statistics,
List<Website> websites,
List<Portrait> portraits){
this.uri = uri;
this.name = name;
this.link = link;
this.location = location;
this.bio = bio;
this.createdTime = createdTime;
this.account = account;
this.statistics = statistics;
this.websites = websites;
this.portraits = portraits;
}
}