public final class UKBankAccountNumber extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DOES_NOT_PASS_MODULO_CHECK_MSG
Sort code/Bank account number do not pass modulo check message.
|
static String |
INVALID_LENGTH_MSG
Bank account number has invalid length message.
|
static int |
MINIMUM_LENGTH
The minimum length of a bank account number.
|
static String |
NOT_NUMERIC_MSG
Bank account number is not numeric message.
|
static int |
STANDARD_LENGTH
The standard length (length used for validation) of a bank account number.
|
Modifier and Type | Method and Description |
---|---|
static void |
checkBankAccountNumber(String bankAccountNumber)
Determines whether the supplied bankAccountNumber combination is valid.
|
static void |
checkSortCodeAndBankAccountNumber(String sortCode,
String bankAccountNumber)
Determines whether the supplied sortCode and bankAccountNumber combination is valid.
|
static void |
main(String[] args)
For test purpose only.
|
public static final int STANDARD_LENGTH
public static final int MINIMUM_LENGTH
public static final String INVALID_LENGTH_MSG
public static final String NOT_NUMERIC_MSG
public static final String DOES_NOT_PASS_MODULO_CHECK_MSG
public static void checkBankAccountNumber(String bankAccountNumber) throws InvalidArgumentException
bankAccountNumber
- The bank account number.InvalidArgumentException
- When the supplied bankAccountNumber combination is invalid.public static void checkSortCodeAndBankAccountNumber(String sortCode, String bankAccountNumber) throws InvalidArgumentException
UKSortCodeRange
UKSortCodeRange
and passes the modulo test(s)sortCode
- The sort code.bankAccountNumber
- The bank account number.InvalidArgumentException
- When the supplied sort code/bank account number combination is invalid.public static void main(String[] args) throws InvalidArgumentException
args
- Not used.InvalidArgumentException
- When validation fails.Copyright © 2008–2018. All rights reserved.