Class DigitsValidatorForString

  • All Implemented Interfaces:
    jakarta.validation.ConstraintValidator<jakarta.validation.constraints.Digits,​String>

    public class DigitsValidatorForString
    extends Object
    implements jakarta.validation.ConstraintValidator<jakarta.validation.constraints.Digits,​String>
    Validates that the String being validated consists of digits, and matches the pattern defined in the constraint.
    • Constructor Detail

      • DigitsValidatorForString

        public DigitsValidatorForString()
    • Method Detail

      • getIntegral

        public int getIntegral()
      • setIntegral

        public void setIntegral​(int integral)
      • getFractional

        public int getFractional()
      • setFractional

        public void setFractional​(int fractional)
      • initialize

        public void initialize​(jakarta.validation.constraints.Digits annotation)
        Specified by:
        initialize in interface jakarta.validation.ConstraintValidator<jakarta.validation.constraints.Digits,​String>
      • isValid

        public boolean isValid​(String str,
                               jakarta.validation.ConstraintValidatorContext context)
        Specified by:
        isValid in interface jakarta.validation.ConstraintValidator<jakarta.validation.constraints.Digits,​String>