Annotation Interface FieldMatch


@Target(TYPE) @Retention(RUNTIME) @Constraint(validatedBy=FieldMatchValidator.class) @Documented public @interface FieldMatch
Validation annotation to validate that 2 fields have the same value. An array of fields and their matching confirmation fields can be supplied. Example, compare 1 pair of fields:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
    Defines several @FieldMatch annotations on the same element
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<?>[]
     
     
    Class<? extends javax.validation.Payload>[]
     
  • Element Details

    • first

      String first
      Returns:
      The first field
    • second

      String second
      Returns:
      The second field
    • message

      String message
      Default:
      "{constraints.fieldmatch}"
    • groups

      Class<?>[] groups
      Default:
      {}
    • payload

      Class<? extends javax.validation.Payload>[] payload
      Default:
      {}