Constructor vs setter validations
- by Jimmy
I have the following class :
public class Project {
private int id;
private String name;
public Project(int id, String name, Date creationDate, int fps, List<String> frames) {
if(name == null ){
throw new NullPointerException("Name can't be null");
}
if(id == 0 ){
throw new…