Annotation Interface ValidWithGroups


@Documented @Retention(RUNTIME) @Target({FIELD,METHOD,PARAMETER,ANNOTATION_TYPE,TYPE_USE}) @Constraint(validatedBy=Validator.class) public @interface ValidWithGroups
Annotates a field that will validate the field using the validation groups specified in this annotations groups() property.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<?>[]
    The groups which activate this specific validator.
    Get message generated when the annotation fails.
    Class<? extends jakarta.validation.Payload>[]
    The Payload, see for more details.
    Class<?>[]
    The value of groups to use when validating.
  • Element Details

    • message

      String message
      Get message generated when the annotation fails.
      Returns:
      the message
      Default:
      "{dev.getelements.elements.model.ValidForGroups.message}"
    • groups

      Class<?>[] groups
      The groups which activate this specific validator.
      Returns:
      the groups
      Default:
      {}
    • value

      Class<?>[] value
      The value of groups to use when validating. This will override the current group and use the groups specified in this value instead.
      Returns:
      the groups against which to validate
      Default:
      {}
    • payload

      Class<? extends jakarta.validation.Payload>[] payload
      The Payload, see for more details.
      Returns:
      the payload
      Default:
      {}