Erlan Amanatov
12/13/2023, 1:23 PMsealed interface Event
@JvmInline
value class SomeEvent(val value: String): Event
What are the advantages and disadvantages of this approach compared to a data classes?
data class SomeEvent(val value: String): Event
Shahzad Ansari
12/13/2023, 1:34 PMErlan Amanatov
12/13/2023, 1:37 PMmkrussel
12/13/2023, 2:57 PMAlbert Chang
12/13/2023, 3:55 PMEvent
interface instead of the SomeEvent
as parameter type or return type, the value won't be actually inlined. So unless you use SomeEvent
type everywhere (which is likely impossible), there aren't really any advantages of using value class.agrosner
12/13/2023, 10:28 PM