karelpeeters
10/23/2017, 10:33 PMjava.lang.Enum
, can you post your code and error message?Geir
10/24/2017, 6:10 PMorg.neo4j.ogm.typeconversion.EnumConverter
which has the constructor public EnumStringConverter(Class<? extends Enum> enumClass)
.
This is as close as I've gotten, but still compile error:
enum class MyEnum {
ONE, TWO
companion object
}
class MyEnumStringConverter : org.neo4j.ogm.typeconversion.EnumStringConverter(MyEnum.javaClass)
Compile error:
Error:(10, 97) Kotlin: Type inference failed. Expected type mismatch: inferred type is Class<SecurityType.Companion> but Class<out Enum<(raw) Enum<*>>!>! was expected
I tried first without the MyEnum::class
instead of MyEnum.javaClass
which gave this compiler error:
Error:(15, 80) Kotlin: Type mismatch: inferred type is KClass<MyEnum> but Class<out Enum<(raw) Enum<*>>!>! was expected
And MyEnum
.. as well as all above with and without companion object
So, how do I get a Kotlin enum's Class<? extends java.lang.Enum>
?
thanks!