sealed
A class or interface that names every type allowed to extend or implement it.
A sealed class or interface restricts its direct subtypes to those in its permits clause (or, if omitted, those in the same file); each must be final, sealed or non-sealed.
Examples
sealed interface Shape permits Circle, Square {}
See also