-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathOptions.java
More file actions
50 lines (41 loc) · 1.31 KB
/
Options.java
File metadata and controls
50 lines (41 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package main.domain;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public enum Options {
COLD("차가운 음료",List.of(
new Beverage("스프라이트 ", 1500),
new Beverage("코카콜라", 1300),
new Beverage("솔의눈 ", 1000),
new Beverage("펩시 콜라 ", 1100)
)),
HOT("따뜻한 음료", List.of(
new Beverage("TOP커피", 1800),
new Beverage("꿀물", 1500),
new Beverage("홍삼차 ", 1700),
new Beverage("단팥죽 ", 2100)
));
private static final Map<String, Options> beverageToOptions = new HashMap<>();
static {
for (Options menu : Options.values()) {
for (Beverage food : menu.beverages) {
beverageToOptions.put(food.name(), menu);
}
}
}
private final String options;
private final List<Beverage> beverages;
Options(String options, List<Beverage> beverages) {
this.options = options;
this.beverages = beverages;
}
public static Options getUserSelectedOption(int userInput) {
return Options.values()[userInput - 1];
}
public String getOptions() {
return options;
}
public List<Beverage> getBeverages() {
return beverages;
}
}