language-java

Installation
SKILL.md

Java

Records and sealed types

Modern Java models data without boilerplate.

record Point(double x, double y) {}

sealed interface Shape permits Circle, Rectangle {}
record Circle(Point center, double radius) implements Shape {}
record Rectangle(Point topLeft, Point bottomRight) implements Shape {}
  • Use record for immutable data carriers — equals, hashCode, toString, and accessors for free.
  • sealed closes a hierarchy; exhaustive switch replaces instanceof chains.
Installs
2
GitHub Stars
2
First Seen
Jun 10, 2026
language-java — lugassawan/swe-workbench