All Implemented Interfaces:
jakarta.validation.ConstraintValidator<REGON,CharSequence>

public class REGONValidator extends PolishNumberValidator<REGON>
Validator for REGON. Validates both 9 and 14 digits REGON numbers.
Author:
Marko Bekhta
  • Constructor Details

    • REGONValidator

      public REGONValidator()
  • Method Details

    • initialize

      public void initialize(REGON constraintAnnotation)
    • getWeights

      protected int[] getWeights(List<Integer> digits)
      Specified by:
      getWeights in class PolishNumberValidator<REGON>
      Parameters:
      digits - a list of digits to be verified. They are used to determine a size of REGON number - is it 9 or 14 digit number
      Returns:
      an array of weights to be used to calculate a checksum