Annotation Interface StrongPassword


@Target(FIELD) @Retention(RUNTIME) @Constraint(validatedBy=StrongPasswordValidator.class) public @interface StrongPassword
Marks the field for password strength validation.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<?>[]
    Sets the error groups.
    Sets the error message.
    int
    Minimal required password length.
    Class<? extends jakarta.validation.Payload>[]
    Sets the error payload.
    boolean
    Require at least one special character.
  • Element Details

    • minLength

      int minLength
      Minimal required password length.
      Returns:
      minimal required password length
      Default:
      8
    • requireSpecialChars

      boolean requireSpecialChars
      Require at least one special character.
      Returns:
      true if at least one special character is required; otherwise false
      Default:
      false
    • message

      String message
      Sets the error message.
      Returns:
      error message
      Default:
      "Password does not meet complexity requirements."
    • groups

      Class<?>[] groups
      Sets the error groups.
      Returns:
      error groups
      Default:
      {}
    • payload

      Class<? extends jakarta.validation.Payload>[] payload
      Sets the error payload.
      Returns:
      error payload
      Default:
      {}