Exemplo n.º 1
0
 public void validateOverDraftLimitAmount(String amount, String currency, String type) {
   if (type.equals(ArrangementType.CURRENT_ACCOUNT.toString())) {
     validateCurrencyAmount(amount, currency);
   } else if (!(amount.equals("") && currency.equals("")))
     throw new IllegalArgumentException(
         "This type of arrangement should not have a Monthly Payment");
 }
Exemplo n.º 2
0
 public void validateSortCode(String sortCode, String type) {
   if (type.equals(ArrangementType.SAVINGS_ACCOUNT.toString())
       || type.equals(ArrangementType.CURRENT_ACCOUNT.toString())) {
     String regex = "^[0-9]{6}$";
     if (!sortCode.matches(regex))
       throw new IllegalArgumentException(sortCode + " is not a valid sort code");
   } else {
     if (!sortCode.equals(""))
       throw new IllegalArgumentException("This type of arrangement should not have a sort code");
   }
 }
Exemplo n.º 3
0
 public void validateAccountNumber(String accNumber, String type) {
   if (type.equals(ArrangementType.SAVINGS_ACCOUNT.toString())
       || type.equals(ArrangementType.CURRENT_ACCOUNT.toString())) {
     String regex = "^[0-9]{8}$";
     if (!accNumber.matches(regex))
       throw new IllegalArgumentException(type + " is not a valid account number");
   } else {
     if (!accNumber.equals(""))
       throw new IllegalArgumentException(type + " is not a valid account number");
   }
 }