
net.chestmc.common.registry.ImmutableRegistry.kt Maven / Gradle / Ivy
package net.chestmc.common.registry
import java.util.*
/**
* A immutable implementation of [Registry].
*/
open class ImmutableRegistry(
delegate: Map = emptyMap()
) : AbstractRegistry(Collections.unmodifiableMap(delegate)) {
override fun submit(key: K, value: V): V? {
throw UnsupportedOperationException("Immutable registry cannot submit new values.")
}
override fun putAll(from: Map) {
throw UnsupportedOperationException("Immutable registry cannot submit new values.")
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy