I want use this Java code in order to create Java Object:
public class NotificationMessage implements Serializable {
private static final long serialVersionUID = 985577913631100757L;
private int id;
private String uniqueid;
private String status;
private String type;
private Map<String, String> map;
private Date created_at;
public NotificationMessage() {
}
public NotificationMessage(int id, String uniqueid, String status, String type, Map<String, String> map,
Date created_at) {
this.id = id;
this.uniqueid = uniqueid;
this.status = status;
this.type = type;
this.map = map;
this.created_at = created_at;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
....
}
How I can use builder in order to minimize setters when I want to create Java object?
I want to set values like this:
NotificationMessage.builder().id(123).uniqueid(1234).status("active")