Annotation Type Positive


  • @Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE})
    @Retention(RUNTIME)
    @Repeatable(List.class)
    @Documented
    @Constraint(validatedBy={})
    public @interface Positive
    The annotated element must be a strictly positive number (i.e. 0 is considered as an invalid value).

    Supported types are:

    • BigDecimal
    • BigInteger
    • byte, short, int, long, float, double and their respective wrappers

    null elements are considered valid.

    Since:
    2.0
    Author:
    Gunnar Morling
    • 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.Positive.message}"
      • groups

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

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