Class IBANCheckDigitTest
- java.lang.Object
-
- org.apache.bval.extras.constraints.checkdigit.AbstractCheckDigitTest
-
- org.apache.bval.extras.constraints.checkdigit.IBANCheckDigitTest
-
public class IBANCheckDigitTest extends AbstractCheckDigitTest
IVAN Check Digit Test.
-
-
Constructor Summary
Constructors Constructor Description IBANCheckDigitTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
checkDigit(String code)
Returns the check digit (i.e.protected String[]
createInvalidCodes(String[] codes)
Returns an array of codes with invalid check digits.int
getCheckDigitLth()
protected jakarta.validation.ConstraintValidator<? extends Annotation,? super String>
getConstraint()
protected String[]
getInvalid()
String
getMissingMessage()
protected String[]
getValid()
protected String
getZeroSum()
protected String
removeCheckDigit(String code)
Returns a code with the Check Digit (i.e.void
testZeroSum()
Test zero sum-
Methods inherited from class org.apache.bval.extras.constraints.checkdigit.AbstractCheckDigitTest
setUp, tearDown, testIsValidFalse, testIsValidTrue, testMissingCode
-
-
-
-
Method Detail
-
getCheckDigitLth
public int getCheckDigitLth()
- Overrides:
getCheckDigitLth
in classAbstractCheckDigitTest
-
getConstraint
protected jakarta.validation.ConstraintValidator<? extends Annotation,? super String> getConstraint()
- Specified by:
getConstraint
in classAbstractCheckDigitTest
-
getValid
protected String[] getValid()
- Specified by:
getValid
in classAbstractCheckDigitTest
-
getInvalid
protected String[] getInvalid()
- Overrides:
getInvalid
in classAbstractCheckDigitTest
-
getZeroSum
protected String getZeroSum()
- Overrides:
getZeroSum
in classAbstractCheckDigitTest
-
getMissingMessage
public String getMissingMessage()
- Overrides:
getMissingMessage
in classAbstractCheckDigitTest
-
testZeroSum
public void testZeroSum()
Test zero sum- Overrides:
testZeroSum
in classAbstractCheckDigitTest
-
createInvalidCodes
protected String[] createInvalidCodes(String[] codes)
Description copied from class:AbstractCheckDigitTest
Returns an array of codes with invalid check digits.- Overrides:
createInvalidCodes
in classAbstractCheckDigitTest
- Parameters:
codes
- Codes with valid check digits- Returns:
- Codes with invalid check digits
-
removeCheckDigit
protected String removeCheckDigit(String code)
Returns a code with the Check Digit (i.e. last character) removed.- Overrides:
removeCheckDigit
in classAbstractCheckDigitTest
- Parameters:
code
- The code- Returns:
- The code without the check digit
-
checkDigit
protected String checkDigit(String code)
Returns the check digit (i.e. last character) for a code.- Overrides:
checkDigit
in classAbstractCheckDigitTest
- Parameters:
code
- The code- Returns:
- The check digit
-
-