Class TransferUtils

java.lang.Object
lock.core.banking.TransferUtils

public class TransferUtils extends Object
Author:
Ben Choi
  • Constructor Details

    • TransferUtils

      public TransferUtils()
  • Method Details

    • checkBalanceAndTransfer

      public static TransferResult checkBalanceAndTransfer​(Account sender, Account recipient, int amount)
      This method checks whether the sender has enough money in her bank account to transfer the given amount to the recipient. It also checks to make sure that the sender and recipient are not the same people. If all of those conditions are met, it will successfully transfer the funds.
      Parameters:
      sender - the Account instance of the sender
      recipient - the Account instance of the recipient
      amount - the amount the sender is trying to send to the recipient
      Returns:
      the result of this transaction