Skip to content

Commit 8b8b65c

Browse files
chore: spotlessApply
1 parent c9224e8 commit 8b8b65c

File tree

6 files changed

+19
-24
lines changed

6 files changed

+19
-24
lines changed
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
package com.codedifferently.lesson17.bank;
22

3-
public class AuditLog {
4-
5-
}
3+
public class AuditLog {}

lesson_17/bank/bank_app/src/main/java/com/codedifferently/lesson17/bank/BankAtm.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import com.codedifferently.lesson17.bank.exceptions.AccountNotFoundException;
44
import com.codedifferently.lesson17.bank.exceptions.UnsupportedCurrencyException;
5-
65
import java.util.HashMap;
76
import java.util.Map;
87
import java.util.Set;
@@ -48,7 +47,8 @@ public Set<CheckingAccount> findAccountsByCustomerId(UUID customerId) {
4847
* @param amount The amount to deposit.
4948
* @throws UnsupportedCurrencyException
5049
*/
51-
public void depositFunds(String accountNumber, double amount, String currencyType) throws UnsupportedCurrencyException {
50+
public void depositFunds(String accountNumber, double amount, String currencyType)
51+
throws UnsupportedCurrencyException {
5252
CheckingAccount account = getAccountOrThrow(accountNumber);
5353
double convertedAmount = CurrencyConverter.convert(amount, currencyType, "USD");
5454
account.deposit(convertedAmount);

lesson_17/bank/bank_app/src/main/java/com/codedifferently/lesson17/bank/BusinessCheckingAccount.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ public class BusinessCheckingAccount extends CheckingAccount {
1212
* @param owners The owners of the account.
1313
* @param initialBalance The initial balance of the account.
1414
*/
15-
public BusinessCheckingAccount(String accountNumber, Set<Customer> owners, double initialBalance) {
15+
public BusinessCheckingAccount(
16+
String accountNumber, Set<Customer> owners, double initialBalance) {
1617
super(accountNumber, owners, initialBalance);
1718
isActive = true;
1819
}
19-
2020
}
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
package com.codedifferently.lesson17.bank;
22

3-
import java.util.Map;
4-
53
import com.codedifferently.lesson17.bank.exceptions.UnsupportedCurrencyException;
4+
import java.util.Map;
65

76
public class CurrencyConverter {
8-
private static final Map<String, Double> exchangeRates = Map.of(
9-
"USD", 1.0,
10-
"EUR", 0.9,
11-
"GBP", 0.8,
12-
"JPY", 110.0
13-
);
7+
private static final Map<String, Double> exchangeRates =
8+
Map.of(
9+
"USD", 1.0,
10+
"EUR", 0.9,
11+
"GBP", 0.8,
12+
"JPY", 110.0);
1413

15-
public static double convert(double amount, String fromCurrency, String toCurrency) throws UnsupportedCurrencyException {
16-
if (!exchangeRates.containsKey(fromCurrency) || !exchangeRates.containsKey(toCurrency)) {
17-
throw new UnsupportedCurrencyException("Unsupported currency type.");
18-
}
19-
double amountInUSD = amount / exchangeRates.get(fromCurrency);
20-
return amountInUSD * exchangeRates.get(toCurrency);
14+
public static double convert(double amount, String fromCurrency, String toCurrency)
15+
throws UnsupportedCurrencyException {
16+
if (!exchangeRates.containsKey(fromCurrency) || !exchangeRates.containsKey(toCurrency)) {
17+
throw new UnsupportedCurrencyException("Unsupported currency type.");
18+
}
19+
double amountInUSD = amount / exchangeRates.get(fromCurrency);
20+
return amountInUSD * exchangeRates.get(toCurrency);
2121
}
2222
}

lesson_17/bank/bank_app/src/main/java/com/codedifferently/lesson17/bank/MoneyOrder.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ public class MoneyOrder {
44
private double amount;
55
private CheckingAccount account;
66

7-
8-
97
/**
108
* Creates a new check.
119
*

lesson_17/bank/bank_app/src/test/java/com/codedifferently/lesson17/bank/BankAtmTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import com.codedifferently.lesson17.bank.exceptions.AccountNotFoundException;
77
import com.codedifferently.lesson17.bank.exceptions.CheckVoidedException;
88
import com.codedifferently.lesson17.bank.exceptions.UnsupportedCurrencyException;
9-
109
import java.util.Set;
1110
import java.util.UUID;
1211
import org.junit.jupiter.api.BeforeEach;

0 commit comments

Comments
 (0)