mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-08 10:58:45 +07:00
GitOrigin-RevId: 071a06a35d844a6d33980764cf142af7bb4e57ac
20 lines
404 B
Java
20 lines
404 B
Java
// "Migrate to enhanced switch with rules" "true-preview"
|
|
public class IDEA_372961 {
|
|
public enum SomeType {
|
|
TYPE_1,
|
|
TYPE_2,
|
|
TYPE_UNKNOWN;
|
|
|
|
|
|
public static SomeType fromValue(String value) {
|
|
return switch<caret> (value) {
|
|
case "type_1":
|
|
case "type_2":
|
|
case "type_3":
|
|
yield TYPE_1;
|
|
default:
|
|
yield TYPE_UNKNOWN;
|
|
};
|
|
}
|
|
}
|
|
} |