Annotation Type NotEmpty


  • @Documented
    @Constraint(validatedBy={})
    @Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE})
    @Retention(RUNTIME)
    @Repeatable(List.class)
    public @interface NotEmpty
    The annotated element must not be null nor empty.

    Supported types are:

    • CharSequence (length of character sequence is evaluated)
    • Collection (collection size is evaluated)
    • Map (map size is evaluated)
    • Array (array length is evaluated)
    Since:
    2.0
    Author:
    Emmanuel Bernard, Hardy Ferentschik
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.Class<?>[] groups  
      java.lang.String message  
      java.lang.Class<? extends Payload>[] payload  
    • Element Detail

      • message

        java.lang.String message
        Default:
        "{jakarta.validation.constraints.NotEmpty.message}"
      • groups

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

        java.lang.Class<? extends Payload>[] payload
        Default:
        {}