vicpinm / Kotlin-Realm-Extensions

Kotlin extensions to simplify Realm API.
Apache License 2.0
535 stars 53 forks source link

Accessing Kotlin Extension from Java #6

Closed akbarsha03 closed 7 years ago

akbarsha03 commented 7 years ago

Do I have to always pass an object from Java to access the kotlin extenion like below?

final ChatConversationsRealm F = new ChatConversationsRealm();
List<ChatConversationsRealm> xx = RealmExtensionsKt.queryAll(F);

Is there any way to access it without creating an object but just by specifying the type like RealmExtensionsKt.queryAll(ChatConversationsRealm.class)?

vicpinm commented 7 years ago

I'm afraid it is not possible right now. You will need to create a new instance of your object to perform your query. I'm aware of this and I could find another way to perform the queries in the future if I have enough time. If you want to propose any solution, you are welcome to do a pull request.