Rudy Sulley
09/04/2023, 6:51 PMChris Lee
09/04/2023, 7:19 PMtoString()
implementations, saving you from having to add that yourself.Rudy Sulley
09/04/2023, 10:30 PMSzymon Jeziorski
09/06/2023, 7:56 AMequals
and toString
. This may be important in the use cases when they are created using reflection bypassing their singleton nature.
I once had a situation where jackson was creating object
using reflection on json deserialization. That object was subclassing sealed interface and out of nowhere my exhaustive when
expression started throwing NoWhenBranchMatchedException
because object created by jackson wasn't the same instance as the one which should be the singleton in memory. `data object`s ensure such issues would not happen