mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 04:15:06 +00:00
14 lines
298 B
Java
14 lines
298 B
Java
// version 21:
|
|
record Point(int x, int y) {
|
|
}
|
|
record Rectangle(Point upperLeft, Point lowerRight) {
|
|
}
|
|
|
|
public class RecordPattern21 {
|
|
void recordPattern(Object o) {
|
|
if (o instanceof Point(int x, int y)) {
|
|
}
|
|
if (o instanceof Rectangle(Point(var x1, var y1), Point(int x2, int y2))) {
|
|
}
|
|
}
|
|
} |