com.skillw.pouvoir.api.plugin.map.BaseMap.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Pouvoir Show documentation
Show all versions of Pouvoir Show documentation
Bukkit Script Engine Plugin.
package com.skillw.pouvoir.api.plugin.map
import java.util.*
import java.util.concurrent.ConcurrentHashMap
/**
* Base map
*
* @param K
* @param V
* @constructor Create empty Base map
*/
open class BaseMap : ConcurrentHashMap(), RegContainer {
override operator fun get(key: K): V? {
return super.get(key)
}
private val uuid = UUID.randomUUID()
override fun register(key: K, value: V): V? {
return put(key, value)
}
override fun remove(key: K, value: V): Boolean {
return super.remove(key, value)
}
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is BaseMap<*, *>) return false
return uuid == other.uuid
}
override fun hashCode(): Int {
return uuid.hashCode()
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy