I have a POJO class like below,
@XmlRootElement
public class JsonReply {
@XmlElement(nillable = false)
String callResult;
@XmlElement(nillable=false)
String returnobj;
@NotNull
String callError;
public String getCallResult() {
return callResult;
}
public void setCallResult(String callResult) {
this.callResult = callResult;
}
public String getCallError() {
return callError;
}
public void setCallError(String callError) {
this.callError = callError;
}
To avoid a null string I am using many annotations like Lombok's @NotNull and javax.xml.bind.annotation.XmlRootElement's @XmlElement(nillable=false). And my question is that Is any other way or annotation to restrict a length for Integer or String like min=5 and max=10.
@Size(max=10)
@Max(5)
Integer sampleint;
I am using Jackson. if any annotation is there in Jackson itself like @JsonIgnoreProperties then very fine.
Thanks!