SalomonBrys / Kotson

Kotlin bindings for JSON manipulation via Gson
MIT License
709 stars 37 forks source link

Using delegate to map to array of Strings #36

Open nibuen opened 6 years ago

nibuen commented 6 years ago

Would be nice to map directly to Array of Strings if possible. Might be missing how to do this, but this is my current way of doing so:

    private val _modes by obj.byNullableArray("MODES")
    val modes: Array<String>? by lazy {
        _modes?.map { it.string }?.toTypedArray()
    }