Top "Kotlin" questions

Kotlin is an open-source, statically typed programming language supported and developed by JetBrains.

Smart cast to 'Type' is impossible, because 'variable' is a mutable property that could have been changed by this time

And the Kotlin newbie asks, "why won't the following code compile?": var left: Node? = null fun show() { if (left != null) { …

kotlin
Setting text in EditText Kotlin

I am trying to set text in a EditText but it says: Type mismatch. Required: Editable Found: String My code …

android kotlin android-edittext
Unresolved reference: kotlinx

I am trying to try out Kotlin and the Kotlin Android extensions in Android Studio. I have tried this both …

android-studio kotlin kotlin-android-extensions
Extend data class in Kotlin

Data classes seem to be the replacement to the old-fashioned POJOs in Java. It is quite expectable that these classes …

inheritance kotlin abstract data-class
How to do bulk (multi row) inserts with JpaRepository?

When calling the saveAll method of my JpaRepository with a long List<Entity> from the service layer, trace …

hibernate spring-boot kotlin spring-data-jpa cockroachdb
How can I filter an ArrayList in Kotlin so I only have elements which match my condition?

I have an array: var month: List<String> = arrayListOf("January", "February", "March") I have to filter the list …

list kotlin filtering
How to convert String to Long in Kotlin?

So, due to lack of methods like Long.valueOf(String s) I am stuck. How to convert String to Long …

kotlin
How to work with Maps in Kotlin

The code below is creating a new map called nameTable, then adding an entry named example to it, then trying …

maps kotlin
Kotlin Data Class from Json using GSON

I have Java POJO class like this: class Topic { @SerializedName("id") long id; @SerializedName("name") String name; } and I have …

java json gson kotlin data-class
Kotlin addTextChangeListener lambda?

How do you build a lambda expression for the EditText addTextChangeListener in Kotlin? Below gives an error: passwordEditText.addTextChangedListener { charSequence …

android kotlin textview anko