commonMain.io.github.lyxnx.util.Map.kt Maven / Gradle / Ivy
@file:JvmName("Maps")
package io.github.lyxnx.util
import kotlin.jvm.JvmName
/**
* Returns whether this map contains [key] and all of [keys]
*/
public fun Map.containsKeys(key: K, vararg keys: K): Boolean =
containsKey(key) && keys.all(::containsKey)
/**
* Returns whether this map contains all the keys given in the collection [keys]
*/
public fun Map.containsKeys(keys: Collection): Boolean = keys.all(::containsKey)
/**
* Returns whether this map contains [value] and all of [values]
*/
public fun Map<*, V>.containsValues(value: V, vararg values: V): Boolean =
containsValue(value) && values.all(::containsValue)
/**
* Returns whether this map contains all the values given in the collection [values]
*/
public fun Map<*, V>.containsValues(values: Collection): Boolean = values.all(::containsValue)