Descripción
Switch expression with pattern matching by type (Java 21+)
File Template: ❌
Prefix
switch:pattern
Scopes
java
Snippet de código
return switch (${1:obj}) {
case String ${2:s} -> ${2:s}.length();
case Integer ${3:i} -> ${3:i};
case null -> ${4:0};
default -> ${5:-1};
};