From d60463f32abb69df1eb12690589fb809a8b44452 Mon Sep 17 00:00:00 2001 From: JUN Date: Tue, 18 Apr 2023 19:27:25 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=B6=9C=EB=A0=A5=20=EB=A9=94?= =?UTF-8?q?=EC=84=9C=EB=93=9C=20Wrapping=20#1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../view/OutputView.java | 64 ++++++++++--------- 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/firstSeminarAdvancedAssignment/src/main/java/sopt/org/firstSeminarAdvancedAssignment/view/OutputView.java b/firstSeminarAdvancedAssignment/src/main/java/sopt/org/firstSeminarAdvancedAssignment/view/OutputView.java index c33ada7..71d00ad 100644 --- a/firstSeminarAdvancedAssignment/src/main/java/sopt/org/firstSeminarAdvancedAssignment/view/OutputView.java +++ b/firstSeminarAdvancedAssignment/src/main/java/sopt/org/firstSeminarAdvancedAssignment/view/OutputView.java @@ -7,116 +7,122 @@ public class OutputView { // 고객 등록 메세지 public void printInputClientInfoMessage() { printEnter(); - System.out.println(REGISTER_CLIENT_MESSAGE); + println(REGISTER_CLIENT_MESSAGE); } public void printInputAccountNumberForRegisterMessage() { - System.out.println(INPUT_REGISTER_ACCOUNT_NUMBER_MESSAGE); + println(INPUT_REGISTER_ACCOUNT_NUMBER_MESSAGE); } public void printInputBirthForRegisterMessage() { - System.out.println(INPUT_REGISTER_CLIENT_BIRTH_MESSAGE); + println(INPUT_REGISTER_CLIENT_BIRTH_MESSAGE); } public void printInputTelNumberForRegisterMessage() { - System.out.println(INPUT_REGISTER_CLIENT_TEL_MESSAGE); + println(INPUT_REGISTER_CLIENT_TEL_MESSAGE); } public void printInputAddressForRegisterMessage() { - System.out.println(INPUT_REGISTER_CLIENT_ADDRESS_MESSAGE); + println(INPUT_REGISTER_CLIENT_ADDRESS_MESSAGE); } public void printInputPasswordForRegisterMessage() { - System.out.println(INPUT_REGISTER_CLIENT_PASSWORD_MESSAGE); + println(INPUT_REGISTER_CLIENT_PASSWORD_MESSAGE); } //잔액 조회 메세지 public void printCheckAccountBalanceMessage() { printEnter(); - System.out.println(CHECK_ACCOUNT_BALANCE_MESSAGE); + println(CHECK_ACCOUNT_BALANCE_MESSAGE); } public void printClientAmountBalance(int amount) { //! 메서드명 수정 필요 - System.out.printf(CLIENT_ACCOUNT_BALANCE_AMOUNT_MESSAGE, amount); - printEnter(); + printf(CLIENT_ACCOUNT_BALANCE_AMOUNT_MESSAGE, amount); } //출금 메세지 public void printWithdrawAccountBalanceMessage() { printEnter(); - System.out.println(CLIENT_WITHDRAW_MESSAGE); + println(CLIENT_WITHDRAW_MESSAGE); } public void printWithdrawAmountMessage() { - System.out.println(INPUT_WITHDRAW_AMOUNT_MESSAGE); + println(INPUT_WITHDRAW_AMOUNT_MESSAGE); } public void printRemainAmountAfterWithdrawMessage(int amount) { - System.out.printf(WITHDRAW_SUCCESS_MESSAGE, amount); + printf(WITHDRAW_SUCCESS_MESSAGE, amount); } //입금 메세지 public void printDepositIntoAccountMessage() { printEnter(); - System.out.println(CLIENT_DEPOSIT_MESSAGE); + println(CLIENT_DEPOSIT_MESSAGE); } public void printDepositMoneyAmountMessage() { - System.out.println(INPUT_DEPOSIT_AMOUNT_MESSAGE); + println(INPUT_DEPOSIT_AMOUNT_MESSAGE); } public void printAmountAfterDeposit(int amount) { - System.out.printf(DEPOSIT_SUCCESS_MESSAGE, amount); - printEnter(); + printf(DEPOSIT_SUCCESS_MESSAGE, amount); } //송금 메세지 public void printAnotherAccountToTransferMoneyMessage() { - System.out.println(CLIENT_TRANSFER_MESSAGE); + println(CLIENT_TRANSFER_MESSAGE); } public void printTransferAmountMessage() { - System.out.println(INPUT_TRANSFER_AMOUNT_MESSAGE); + println(INPUT_TRANSFER_AMOUNT_MESSAGE); } public void printRemainAmountAfterTransferMessage(int amount) { - System.out.printf(TRANSFER_SUCCESS_MESSAGE,amount); - printEnter(); + printf(TRANSFER_SUCCESS_MESSAGE,amount); } //기본 메세지 public void printInputClientNameMessage() { - System.out.println(INPUT_CLIENT_NAME_MESSAGE); + println(INPUT_CLIENT_NAME_MESSAGE); } public void printInputAccountNumberMessage() { - System.out.println(INPUT_ACCOUNT_NUMBER_MESSAGE); + println(INPUT_ACCOUNT_NUMBER_MESSAGE); } public void printInputPasswordMessage() { - System.out.println(INPUT_ACCOUNT_PASSWORD_MESSAGE); + println(INPUT_ACCOUNT_PASSWORD_MESSAGE); } public void printWelcomeMessage() { - System.out.println(WELCOME_MESSAGE); + println(WELCOME_MESSAGE); } public void printExitMessage() { - System.out.println(EXIT_MESSAGE); + println(EXIT_MESSAGE); } public void printInputBankingJobMessage() { printEnter(); - System.out.println(INPUT_BANKING_JOB_MESSAGE); + println(INPUT_BANKING_JOB_MESSAGE); } - private void printEnter() { - System.out.println(); + private static void printEnter() { + println(""); + } + + private static void println(String message) { + System.out.println(message); + } + + private static void printf(String message, int param) { + System.out.printf(message,param); + printEnter(); } public static void printError(Exception error) { - System.out.println(error.getMessage()); + println(error.getMessage()); } }