Module jakarta.validation
Package jakarta.validation.constraints
Annotation Interface NegativeOrZero
@Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE})
@Retention(RUNTIME)
@Repeatable(NegativeOrZero.List.class)
@Documented
@Constraint(validatedBy={})
public @interface NegativeOrZero
The annotated element must be a negative number or 0.
Supported types are:
BigDecimal
BigInteger
byte
,short
,int
,long
,float
,double
and their respective wrappers
null
elements are considered valid.
- Since:
- 2.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic @interface
Defines severalNegativeOrZero
constraints on the same element. -
Optional Element Summary