Title
h

horse_badorties

08/09/2017, 7:44 AM
is there a
java.util.EnumSet
equivalent in Kotlin? If not (how) can I use it with a Kotlin
enum class
?
e

elizarov

08/09/2017, 7:57 AM
just use
java.util.EnumSet
. It works fine with Kotlin’s
enum class
.
h

horse_badorties

08/09/2017, 8:02 AM
Great, thanks. I didn't get the syntax right though 😅
enum class AnEnum { ONE, TWO, THREE, FOUR }
val x = EnumSet.allOf(AnEnum::class)
This does not compile, how would I do it?
j

johnaqel

08/09/2017, 8:18 AM
@horse_badorties
EnumSet.allOf(AnEnum::class.java)
h

horse_badorties

08/09/2017, 8:24 AM
thanks 👍