oωo (owo-lib)

oωo (owo-lib)

17M Downloads

Kotlin Registration

dnllbz opened this issue · 2 comments

commented

Is it possible to implement auto-registration in Kotlin? Java and Kotlin have differences, such as static in Java and companion object in Kotlin. Because of this, I guess, it can't be done at that moment

commented

While it is not extensively documented, as none of the core dev team actively uses Kotlin, it is very much doable.
Annotating your fields with @JvmField and using a companion object you are able to use the auto-registry. Make sure your outer class implements the Registry Container of your choice

commented

Thanks, it worked. Before that I tried to use @JvmStatic but it didn't work, interesting to read what are the differences