We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fe1eecf commit 410e4c2Copy full SHA for 410e4c2
src/main/java/com/programmers/springweekly/domain/voucher/VoucherFactory.java
@@ -6,15 +6,9 @@ public class VoucherFactory {
6
7
public static Voucher createVoucher(UUID voucherId, VoucherType voucherType, long discount) {
8
9
- switch (voucherType) {
10
- case FIXED -> {
11
- return new FixedAmountVoucher(voucherId, discount);
12
- }
13
- case PERCENT -> {
14
- return new PercentDiscountVoucher(voucherId, discount);
15
16
- default -> throw new IllegalArgumentException("Input: " + voucherType + "바우처 타입이 없습니다.");
17
+ return switch (voucherType) {
+ case FIXED -> new FixedAmountVoucher(voucherId, discount);
+ case PERCENT -> new PercentDiscountVoucher(voucherId, discount);
+ };
18
}
19
-
20
0 commit comments