/** * Validate a modulus check digit for a code. * <p> * Note: assumes last digit is the check digit * * @param code The code to validate * @return <code>true</code> if the check digit is valid, otherwise * <code>false</code> */ @Override public boolean isValid(String code) { if (code == null || code.length() == 0) { return false; } if (!Character.isDigit(code.charAt(code.length() - 1))) { return false; } return super.isValid(code); }
/** * Validate a modulus check digit for a code. * <p> * Note: assumes last digit is the check digit * * @param code The code to validate * @return <code>true</code> if the check digit is valid, otherwise * <code>false</code> */ @Override public boolean isValid(String code) { if (code == null || code.length() == 0) { return false; } if (!Character.isDigit(code.charAt(code.length() - 1))) { return false; } return super.isValid(code); }