dave08
03/27/2024, 1:24 PMsealed interface Foo
sealed interface FooForBar : Foo {
val bar: Bar
}
@JvmInline
value class Bar(val value: String) {
companion object {
val EMPTY = Bar("")
}
}
And I need to manage a list of Foos that don't derive from ForForBar and a Map<Bar, ForForBar>
is it a bad practice to keep them both in one map and to use Bar.EMPTY
as the key for the ones deriving only from Foo?CLOVIS
03/27/2024, 1:30 PMdave08
03/27/2024, 1:33 PMdave08
03/27/2024, 1:47 PMdave08
03/27/2024, 1:48 PMUlrich Schuster
03/27/2024, 1:57 PMdave08
03/27/2024, 1:57 PM