11package com .codedifferently .lesson17 .bank ;
22
3+ import com .codedifferently .lesson17 .bank .exceptions .AccountNotFoundException ;
34import java .util .HashMap ;
45import java .util .Map ;
56import java .util .Set ;
67import java .util .UUID ;
78
8- import com .codedifferently .lesson17 .bank .exceptions .AccountNotFoundException ;
9-
10- /**
9+ /**
1110 * Represents a bank ATM system that manages customer accounts and transactions.
12- *
13- * <p>This ATM supports various types of checking accounts including standard
14- * {@link CheckingAccount} and specialized {@link BusinessCheckingAccount} instances.
15- * The system uses polymorphism to treat all account types uniformly, enabling
16- * seamless operations regardless of the specific account implementation.
17- *
11+ *
12+ * <p>This ATM supports various types of checking accounts including standard {@link
13+ * CheckingAccount} and specialized {@link BusinessCheckingAccount} instances. The system uses
14+ * polymorphism to treat all account types uniformly, enabling seamless operations regardless of the
15+ * specific account implementation.
16+ *
1817 * <p>Supported operations include:
18+ *
1919 * <ul>
20- * <li>Adding accounts to the system</li>
21- * <li>Finding accounts by customer ID</li>
22- * <li>Depositing funds (cash or check) with multi-currency support</li>
23- * <li>Withdrawing funds</li>
20+ * <li>Adding accounts to the system
21+ * <li>Finding accounts by customer ID
22+ * <li>Depositing funds (cash or check) with multi-currency support
23+ * <li>Withdrawing funds
2424 * </ul>
25- *
26- * <p>The ATM supports deposits in multiple currencies including USD, EUR, GBP, JPY,
27- * CAD, AUD, CHF, and CNY. All currency conversions are handled automatically using
28- * the integrated {@link CurrencyConverter}, with all account balances maintained in USD.
29- *
30- * <p>The ATM maintains internal mappings of customers and accounts for efficient
31- * lookup operations and enforces business rules such as account existence validation.
32- *
25+ *
26+ * <p>The ATM supports deposits in multiple currencies including USD, EUR, GBP, JPY, CAD, AUD, CHF,
27+ * and CNY. All currency conversions are handled automatically using the integrated {@link
28+ * CurrencyConverter}, with all account balances maintained in USD.
29+ *
30+ * <p>The ATM maintains internal mappings of customers and accounts for efficient lookup operations
31+ * and enforces business rules such as account existence validation.
32+ *
3333 * @see CheckingAccount
3434 * @see BusinessCheckingAccount
3535 * @see Customer
@@ -43,30 +43,29 @@ public class BankAtm {
4343 private final Map <UUID , Customer > customerById = new HashMap <>();
4444 private final Map <String , CheckingAccount > accountByNumber = new HashMap <>();
4545 private final CurrencyConverter currencyConverter ;
46-
46+
4747 /**
4848 * Creates a new BankAtm with default currency conversion support.
49- *
50- * <p>Initializes the ATM system with an empty set of accounts and customers,
51- * and sets up currency conversion capabilities for multi-currency deposits.
49+ *
50+ * <p>Initializes the ATM system with an empty set of accounts and customers, and sets up currency
51+ * conversion capabilities for multi-currency deposits.
5252 */
5353 public BankAtm () {
5454 this .currencyConverter = new CurrencyConverter ();
5555 }
5656
5757 /**
5858 * Adds a checking account to the ATM system.
59- *
60- * <p>This method accepts any type of checking account, including standard
61- * {@link CheckingAccount} and {@link BusinessCheckingAccount} instances.
62- * The account and all its owners are registered in the system for lookup operations.
63- *
64- * <p>After adding an account, customers can perform transactions using the
65- * account number, and the account can be found using any owner's customer ID.
59+ *
60+ * <p>This method accepts any type of checking account, including standard {@link CheckingAccount}
61+ * and {@link BusinessCheckingAccount} instances. The account and all its owners are registered in
62+ * the system for lookup operations.
63+ *
64+ * <p>After adding an account, customers can perform transactions using the account number, and
65+ * the account can be found using any owner's customer ID.
6666 *
6767 * @param account The checking account to add (including business accounts)
6868 * @throws NullPointerException if the account is null
69- *
7069 * @see BusinessCheckingAccount
7170 * @see #findAccountsByCustomerId(UUID)
7271 */
@@ -94,14 +93,14 @@ public Set<CheckingAccount> findAccountsByCustomerId(UUID customerId) {
9493
9594 /**
9695 * Deposits funds into an account with automatic currency conversion to USD.
97- *
98- * <p>This method accepts deposits in various currencies and automatically
99- * converts the amount to USD using current exchange rates before depositing
100- * into the account. All account balances are maintained in USD.
101- *
102- * <p>Supported currencies include USD, EUR, GBP, JPY, CAD, AUD, CHF, and CNY.
103- * Exchange rates are managed by the internal {@link CurrencyConverter}.
104- * For USD deposits, the amount is deposited directly without conversion overhead.
96+ *
97+ * <p>This method accepts deposits in various currencies and automatically converts the amount to
98+ * USD using current exchange rates before depositing into the account. All account balances are
99+ * maintained in USD.
100+ *
101+ * <p>Supported currencies include USD, EUR, GBP, JPY, CAD, AUD, CHF, and CNY. Exchange rates are
102+ * managed by the internal {@link CurrencyConverter}. For USD deposits, the amount is deposited
103+ * directly without conversion overhead.
105104 *
106105 * @param accountNumber The account number to deposit funds into
107106 * @param amount The amount to deposit in the specified currency
@@ -110,7 +109,6 @@ public Set<CheckingAccount> findAccountsByCustomerId(UUID customerId) {
110109 * @throws IllegalArgumentException if the amount is negative
111110 * @throws IllegalArgumentException if the currency is null
112111 * @throws UnsupportedOperationException if the currency is not supported
113- *
114112 * @see Currency
115113 * @see CurrencyConverter
116114 */
0 commit comments