@Documented @Repeatable(value: NotEmptyWhenNullableConstraintList) @Target(value: [FIELD, METHOD, PARAMETER, TYPE_USE, ANNOTATION_TYPE]) @Retention(value: RUNTIME) @jakarta.validation.Constraint(validatedBy: []) @interface NotEmptyWhenNullableConstraint
The annotated element must not be empty when it is not null
.
Collection
and Map
types. Message interpolation key is org.klokwrk.lib.lo.validation.constraint.NotEmptyWhenNullableConstraint.message
.
This constraint is very similar to the standard bean validation's NotEmpty
, but this one allows for null
containers and does not report them as violations.