Kotlin Context Receivers: A Comprehensive Guide
Rock the JVM
JULY 9, 2023
toJson () } If we try to compile this code, we’ll get an error since there is no toJson function defined on the Job class: Unresolved reference: toJson Since we don’t want to pollute our domain model, we implement the toJson extension function for the Job domain object. joinToString ( separator = ", " , prefix = "[" , postfix = "]" ) { it.
Let's personalize your content