Annotation Type NotEmptyIfOtherIsNotEmpty
@Documented
@Constraint(validatedBy=NotEmptyIfOtherIsNotEmptyValidator.class)
@Target({TYPE,ANNOTATION_TYPE})
@Retention(RUNTIME)
public @interface NotEmptyIfOtherIsNotEmpty
The annotated bean must contain at least two properties:
Supported types are beans,
- a field that has to be checked (option
field) - a field which entry is compared (option
fieldCompare)
fieldCompare is not empty (null or ""), field must also
not be empty (null or "").Supported types are beans,
null elements are considered valid.- Author:
- Manfred Tremmel
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceDefines several@MustBeFilledIfOtherIsFilledannotations on the same element. -
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionfield name to check.field name to compare. -
Optional Element Summary
Optional Elements
-
Element Details
-
-
message
String messagelocalized message.- Returns:
- localized validation message
- Default:
- "{de.knightsoftnet.validators.shared.NotEmptyIfOtherIsNotEmpty.message}"
-
groups
Class<?>[] groupsgroups to use.- Returns:
- array of validation groups
- Default:
- {}
-
payload
Class<? extends jakarta.validation.Payload>[] payloadpayload whatever.- Returns:
- payload class
- Default:
- {}
-