Annotation Interface Validation.Number.Digits

Enclosing class:
Validation.Number

@Target({METHOD,PARAMETER,ANNOTATION_TYPE,TYPE_USE,RECORD_COMPONENT}) @Constraint public static @interface Validation.Number.Digits
The value must have the at most he defined number of integer() and fraction() digits.

Bytes are considered unsigned values (always between 0 and 255 inclusive).

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    int
    Maximal number of digits to the right of the decimal mark.
    int
    Maximal number of digits to the left of the decimal mark.
    Message to return instead of the default one of the validator.
  • Element Details

    • message

      String message
      Message to return instead of the default one of the validator. The message can be a string format, where the first (and only) parameter will be the actual value that is being validated.
      Returns:
      message to describe the constraint validation error
      Default:
      ""
    • integer

      int integer
      Maximal number of digits to the left of the decimal mark. If this is set to 2, the maximal number supported is 99.
      Returns:
      maximal number of integer digits, not validated by default
      Default:
      -1
    • fraction

      int fraction
      Maximal number of digits to the right of the decimal mark. If this is set to 2, the values can be 0.01, but not 0.001.
      Returns:
      maximal number of fraction digits, not validated by default
      Default:
      -1