Open
Conversation
… logic - Moved numbers field and size validation to AbstractNumbers - Updated Lotto and WinningNumbers to extend AbstractNumbers
…nd Add InputParser util
…into lotto-refactor
hambining
commented
Nov 12, 2025
Comment on lines
+38
to
+44
| lottos.getLottos().stream() | ||
| .map(lotto -> { | ||
| int hits = winningNumbers.countHits(lotto); | ||
| boolean hasBonusNumber = lotto.getNumbers().contains(bonusNumber); | ||
| return Rank.getRank(hits, hasBonusNumber); | ||
| }) | ||
| .forEach(result::addResult); |
Owner
Author
There was a problem hiding this comment.
스트림 변천사
같은 로직인데 어떻ㄱㅔ 하지 고민하다가 스트림을 적용해바씀다
멀 쓸지 고민하다가 그냥 스트림 버전 썼음 왜냐면 난 스트림 쓸 줄 아니까 ㅋ
그냥 먼가 적어두고 싶었음 .. 히히
for (Lotto lotto : lottos.getLottos()) {
int hits = winningNumbers.countHits(lotto);
boolean hasBonusNumber = lotto.getNumbers().contains(bonusNumber);
Rank rank = Rank.getRank(hits, hasBonusNumber);
result.addResult(rank);
} lottos.getLottos().forEach(lotto -> {
int hits = winningNumbers.countHits(lotto);
boolean hasBonusNumber = lotto.getNumbers().contains(bonusNumber);
Rank rank = Rank.getRank(hits, hasBonusNumber);
result.addResult(rank);
});lottos.getLottos().stream()
.map(lotto -> {
int hits = winningNumbers.countHits(lotto);
boolean hasBonusNumber = lotto.getNumbers().contains(bonusNumber);
return Rank.getRank(hits, hasBonusNumber);
})
.forEach(result::addResult);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🧩 도메인 구조 대개편
AbstractNumbers→ Lotto &WinningNumbers상속Validationutil 제거LottoMachine(로또 번호 생성) /Store(돈 관련) 생성🐾 서비스단 리팩토링
🪼 컨트롤러
run()함수 쪼개서 15줄 이내로 수정암튼 뭐 간단해짐 계산 로직이나 결과 출력 열시미 청소 해뜸 🧹
🖨️ 뷰
LottoPrinter생성UserInput에서 파싱 로직 유틸로 이사 🚚🫧 느낀점
너무 졸리네요 😴 졸다가 실수로
푸시 잘못해서 .. ^^ 다시 해씀니다 😿