Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

로또 완성!!! #2105

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

Suxxxxhyun
Copy link

No description provided.

List<Integer> winningNumbers = InputView.inputWinngingNumbers();
return createWinngingNumbers(winningNumbers);
} catch (IllegalArgumentException e){
OutputView.printMessage(e.getMessage());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OutputView도 "private final OutputView outputView" 이렇게 선언해주는게 어떨까요?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

음..!! 그렇게 선언하면 좋은 점이 어떤것인가요!!

Lottos purchaseLottos = generateLottos(purchaseAmount);
lottos = purchaseLottos;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

21, 22번 라인을 이렇게 줄일 수 있을거 같아요!
lottos = generateLottos(purchaseAmount);

}

public List<Lotto> getLottos(){
return lottos;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Collections.unmodifiableList(lottos);
이렇게 사용하면 외부에서 변경하지 못하도록 만들 수 있어요! 👍

참고 : https://tecoble.techcourse.co.kr/post/2020-04-28-ask-instead-of-getter/

}

public HashMap<Rank, Integer> getWinningResult(){
return winningResult;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Collections.unmodifiableMap(winningResult);

Map은 이런 방법으로 불변을 정해 줄 수 있어요 👍

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오..!! 감사합니다!!

return new WinningResultDto(winningResult);
}

public String formatRateOfReturn(){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dto에서 계산해서 format을 만들다니.. 한 수 배웁니다!

import static util.message.ExceptionMessage.*;

public class Validator {
protected static void validateBlank(final String input) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

protected를 사용해서 validator 패키지 내부에서만 사용했군요!! 👍

public class BonusValidatorTest {

@ParameterizedTest
@DisplayName("보너스번호를 ")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오타 발견!! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants