以下のようなPOJOクラスがあります。
@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;
}
null 文字列を回避するために、Lombok の @NotNull や javax.xml.bind.annotation.XmlRootElement の @XmlElement(nillable=false) などの多くの注釈を使用しています。そして私の質問は、min = 5 や max = 10 のように整数または文字列の長さを制限する他の方法または注釈です。
@Size(max=10)
@Max(5)
Integer sampleint;
ジャクソンを使用しています。@JsonIgnoreProperties のような注釈が Jackson 自体にある場合は、非常に問題ありません。
ありがとう!