Comment
Comment by NIckGeek
fwiw in modern-Java they have data classes:
The string is final. While sadly there is no elvis operator, the Optional type helps:
I still strongly dislike working in Java but Java 23 is a long way ahead of the Java 6 I first learnt Java with.