is Empty
Версия Kotlin: 1.1
open override fun isEmpty(): Boolean
Возвращает true, если карта пуста (не содержит элементов), и false в противном случае.
Примеры
import kotlin.test.*
import java.util.*
fun main() {
//sampleStart
println("emptyMap<Int, Int>().isEmpty() is ${emptyMap<Int, Int>().isEmpty()}") // true
println("mapOf(1 to 2).isEmpty() is ${mapOf(1 to 2).isEmpty()}") // false
//sampleEnd
}
© 2010–2026 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-abstract-map/is-empty.html