So I have a simple class like this:
import javax.validation.constraints.Size;
public class Temail {
@Size(min = 0, max = 10)
private String json;
public Temail(String json) {
Validate.notEmpty(json, "json can't be empty");
setJson(json);
}
public void setJson(String json) {
this.json = json;
}
public String getJson() {
return json;
}
}
What I am expecting is if I run new Temail("1234123123123");
I expect it to throw an exception but it does not. I looked at the conventions and it does fit into the right convention. So what's the problem here?