Top "Kotlin-interop" questions

Usage of Kotlin together with other languages, most notably Java.

Comparing two lists in kotlin

I came across with kotlin equals function to compare two list of same type. It works fine for pure Kotlin …

java kotlin kotlin-interop
Convert Kotlin Array to Java varargs

How can I convert my Kotlin Array to a varargs Java String[]? val angularRoutings = arrayOf<String>("/language", "/home") // …

java kotlin interop kotlin-interop
How to implement this Java interface in Kotlin?

Since Kotlin doesn't have primitives, how could this interface be implemented? public interface A { @NotNull Object get(@NotNull Integer i); @…

java kotlin kotlin-interop
how to use spring annotations like @Autowired or @Value in kotlin for primitive types?

Autowiring a non-primitive with spring annotations like @Autowired lateinit var metaDataService: MetaDataService works. But this doesn't work: @Value("\${cacheTimeSeconds}") lateinit …

spring kotlin kotlin-interop kotlin-null-safety
Kotlin extension function access Java private field

I'd like to access Java's private field when using Kotlin extension function. Suppose I have a Java class ABC. ABC …

kotlin kotlin-extension kotlin-interop
Private getter and public setter for a Kotlin property

How to make a property in Kotlin that has a private getter (or just do not have it) but has …

java kotlin kotlin-interop
Class is not abstract and does not implement abstract base class member

I'm confused by this Kotlin error associated with providing an implementation for an abstract class that has been imported from …

kotlin kotlin-interop
Kotlin Native how to convert ByteArray to String?

I was playing with the kotlin-native samples. I wonder how I could get String from pinned ByteArray. Just want to …

kotlin kotlin-interop kotlin-native
Passing a listener object as a function parameter in kotlin

I'm trying to pass a listener from an action to a class (an adapter). In java (code from the Action): …

kotlin kotlin-interop