com.skillw.pouvoir.api.plugin.map.LowerMap.kt Maven / Gradle / Ivy
package com.skillw.pouvoir.api.plugin.map
import java.util.function.BiFunction
import java.util.function.Function
/**
* Lower map
*
* @param V
* @constructor Create empty Lower map
*/
open class LowerMap : BaseMap() {
override operator fun get(key: String): V? {
return super.get(key.lowercase())
}
override fun containsKey(key: String): Boolean {
return super.containsKey(key.lowercase())
}
override fun put(key: String, value: V): V? {
return super.put(key.lowercase(), value)
}
override fun remove(key: String): V? {
return super.remove(key.lowercase())
}
override fun putAll(from: Map) {
super.putAll(from.mapKeys { it.key.lowercase() })
}
override fun computeIfAbsent(key: String, mappingFunction: Function): V {
return super.computeIfAbsent(key.lowercase(), mappingFunction)
}
override fun compute(key: String, remappingFunction: BiFunction): V? {
return super.compute(key.lowercase(), remappingFunction)
}
override fun merge(key: String, value: V, remappingFunction: BiFunction): V? {
return super.merge(key.lowercase(), value, remappingFunction)
}
override fun putIfAbsent(key: String, value: V): V? {
return super.putIfAbsent(key.lowercase(), value)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy