-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtil.java
More file actions
44 lines (37 loc) · 781 Bytes
/
Copy pathUtil.java
File metadata and controls
44 lines (37 loc) · 781 Bytes
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
package prak2;
//enum können wir nicht direkt wiedergeben, Konvertierung in String notwendig
public class Util {
public static String convertWarenartToString(Warenart warenart) {
return switch(warenart) {
//der Pfeil deutet auf den im Speicher hinterlegten Ort für BIER
case BIER -> {
yield "Bier";
}
case WEIN -> {
yield "Wein";
}
case KORN -> {
yield "Korn";
}
case GLAS -> {
yield "Glas";
}
case TUCH -> {
yield "Tuch";
}
case GOLD -> {
yield "Gold";
}
case ROTWEIN -> {
yield "Rotwein";
}
case ROSÈ -> {
yield "Rosè";
}
case WEISSWEIN -> {
yield "Weißwein";
}
default -> throw new IllegalArgumentException("Unexpected value: " + warenart);
};
}
}