public class Person {
private String id;
@Min(value = 1, message = "Age of person id '${id}' must be greater than 0.")
private int age;
}
Is it possible to make '${id}'
take the value of the id field in this class?
Thanks.
public class Person {
private String id;
@Min(value = 1, message = "Age of person id '${id}' must be greater than 0.")
private int age;
}
Is it possible to make '${id}'
take the value of the id field in this class?
Thanks.
No, it's not possible. I have asked a similar question. The problem is that annotations can't deal with variables. Only a final variable can be passed to annotation.