Class CreditCardAccount
java.lang.Object
com.dada.banking_project.models.Accounts.Account
com.dada.banking_project.models.Accounts.CreditCardAccount
-
Constructor Summary
ConstructorDescriptionCreditCardAccount
(BigDecimal balance, String primaryOwner, String secondaryOwner, String status, AccountHolder accountHolder) -
Method Summary
Modifier and TypeMethodDescriptionGet the credit limit for this CreditCard account.Get the interest rate for this CreditCard account.void
setCreditLimit
(BigDecimal creditLimit) Set the credit limit for this CreditCard account.void
setInterestRate
(BigDecimal interestRate) Set the interest rate for this CreditCard account.Methods inherited from class com.dada.banking_project.models.Accounts.Account
checkBalance, checkOwnerName, setSecretKey
-
Constructor Details
-
CreditCardAccount
public CreditCardAccount(BigDecimal balance, String primaryOwner, String secondaryOwner, String status, AccountHolder accountHolder) -
CreditCardAccount
public CreditCardAccount()
-
-
Method Details
-
setCreditLimit
Set the credit limit for this CreditCard account.- Parameters:
creditLimit
- The credit limit to set, must be greater than 100 and less than or equal to 100000- Throws:
IllegalArgumentException
- if credit limit is less than 100 or greater than 100000
-
getCreditLimit
Get the credit limit for this CreditCard account.- Returns:
- The credit limit for this account.
-
setInterestRate
Set the interest rate for this CreditCard account.- Parameters:
interestRate
- The interest rate to set, must be less than or equal to 0.2 and greater than or equal to 0.1- Throws:
IllegalArgumentException
- if interest rate is greater than 0.2 or less than 0.1
-
getInterestRate
Get the interest rate for this CreditCard account.- Returns:
- The interest rate for this account.
-