The name 'data class' kinda speaks for itself, but...
# getting-started
f
The name 'data class' kinda speaks for itself, but I'm guessing there's really no way to create a data class without constructor parameters? I'm currently using sealed classes to represent partial state changes in an application, but writing a
toString()
on each state is getting kinda tedious. Using data classes would solve this for state changes, but some state changes simply don't contain any information. See the example below for what I'm talking about: