mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 12:15:00 +00:00
12 lines
216 B
Java
12 lines
216 B
Java
// version 26:
|
|
public class Switch26 {
|
|
String switchPatternMatching(int i) {
|
|
return switch (i) {
|
|
case 1 -> "one";
|
|
case 5 -> "five";
|
|
case int y when y >= 0 -> "+" + y;
|
|
case int y -> "-" + -y;
|
|
};
|
|
}
|
|
}
|