Annotation Interface Contract.NonNegative
- Enclosing class:
Contract
@API(status=MAINTAINED)
@Contract
@Target({PARAMETER,METHOD,FIELD,ANNOTATION_TYPE})
@Retention(RUNTIME)
@Documented
public static @interface Contract.NonNegative
Requires a numeric value to be greater than or equal to zero.
Supported values are primitive numeric values, numeric wrapper types,
BigDecimal, and BigInteger. A
null object value is ignored and therefore passes.
-
Optional Element Summary
Optional Elements
-
Element Details
-
message
String messageCustom violation description.When non-empty, this text replaces the generated contract description while preserving location details, exception type, and masking behavior.
- Returns:
- the custom violation description, or an empty string to use the generated description
- Default:
""
-