@Constraint(validatedBy=FieldMatchValidator.class) @Documented @Target(value={TYPE,ANNOTATION_TYPE}) @Retention(value=RUNTIME) public @interface FieldMatch
Example, compare 1 pair of fields:
@FieldMatch(first = "password", second = "confirmPassword", message = "The password fields must match")
Example, compare more than 1 pair of fields:
@FieldMatch.List({ @FieldMatch(first = "password", second = "confirmPassword", message = "The password fields must match"), @FieldMatch(first = "email", second = "confirmEmail", message = "The email fields must match") })
public abstract String first
public abstract String second
public abstract String message
public abstract Class<?>[] groups
public abstract Class<? extends javax.validation.Payload>[] payload
Copyright © 2000–2024 Apache Software Foundation. All rights reserved.