Skip to content

Commit

Permalink
refactor: 매직넘버 상수로 추출
Browse files Browse the repository at this point in the history
  • Loading branch information
uwoobeat committed Jan 28, 2025
1 parent f6a536b commit 760a4fb
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@
*/
public class RandomAttendanceNumberGenerator implements AttendanceNumberGenerator {

public static final int MIN_ORIGIN = 1000;
public static final int MAX_BOUND = 10000;

@Override
@SneakyThrows
public int generate() {
return SecureRandom.getInstanceStrong().ints(1000, 10000).findFirst().orElseThrow();
return SecureRandom.getInstanceStrong()
.ints(MIN_ORIGIN, MAX_BOUND)
.findFirst()
.orElseThrow();
}
}

0 comments on commit 760a4fb

Please sign in to comment.