Annotation Interface UniqueAttribute


@Target(FIELD) @Retention(RUNTIME) @Constraint(validatedBy=UniqueAttributeValidator.class) @Repeatable(UniqueAttributes.class) public @interface UniqueAttribute
Validates that the value of a specified attribute in a list of objects is unique.
  • 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

    • message

      String message
      Default:
      "attribute {attribute} must be unique in the list of objects"
    • groups

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

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