As already mentioned in #290, it would be very helpful to have an Annotation like ConstraintTarget on the type level. In my Opinion, the first snipped reduces the amount of boilerplate code, especially if you have (much) more than two properties:
I think we can assume that for a Variable T x there is either a getter T getX() or T x() (or T isX() if x is a boolean). More complex cases could be still written in the classic style by annotating each getter.
Also, this would be really great to work in combination with lombok, so we only would need to write:
@ConstraintTargets
@Value
class Person {
String firstname;
String firstname;
}
However, this might be a different problem, I guess.
Most important: Thanks for this great library!
As already mentioned in #290, it would be very helpful to have an Annotation like
ConstraintTarget
on the type level. In my Opinion, the first snipped reduces the amount of boilerplate code, especially if you have (much) more than two properties:I think we can assume that for a Variable
T x
there is either a getterT getX()
orT x()
(orT isX()
if x is aboolean
). More complex cases could be still written in the classic style by annotating each getter.Also, this would be really great to work in combination with lombok, so we only would need to write:
However, this might be a different problem, I guess.