[Extensions] Make asJsonObjectList return non-nullable JsonObjects.

This commit is contained in:
Kuba Szczodrzyński 2020-01-06 15:05:33 +01:00
parent 4e796542d7
commit 5a77c481a2

View File

@ -95,7 +95,7 @@ operator fun Profile.set(key: String, value: String?) = this.studentData.addProp
operator fun Profile.set(key: String, value: Number) = this.studentData.addProperty(key, value) operator fun Profile.set(key: String, value: Number) = this.studentData.addProperty(key, value)
operator fun Profile.set(key: String, value: Char) = this.studentData.addProperty(key, value) operator fun Profile.set(key: String, value: Char) = this.studentData.addProperty(key, value)
fun JsonArray.asJsonObjectList() = this.map { it.asJsonObject } fun JsonArray.asJsonObjectList() = this.mapNotNull { it.asJsonObject }
fun CharSequence?.isNotNullNorEmpty(): Boolean { fun CharSequence?.isNotNullNorEmpty(): Boolean {
return this != null && this.isNotEmpty() return this != null && this.isNotEmpty()