kr.summitsystems.springbukkit.view.ViewModelStore.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-bukkit-view Show documentation
Show all versions of spring-bukkit-view Show documentation
Springframework based Bukkit plugin development kit.
package kr.summitsystems.springbukkit.view
class ViewModelStore(
private val map: MutableMap = mutableMapOf()
) : MutableMap by map {
override fun put(key: String, value: ViewModel): ViewModel? {
val oldViewModel = map.put(key, value)
oldViewModel?.dispose()
return oldViewModel
}
fun put(viewModel: ViewModel): ViewModel? {
return put(viewModel::class.java.name, viewModel)
}
override fun clear() {
for (viewModel in values) {
viewModel.dispose()
}
map.clear()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy