// Generated by alef. Do not edit by hand.

package dev.kreuzberg

object ValidatorBridge {
    private val registered = mutableMapOf<String, IValidator>()

    fun register(impl: IValidator): Unit {
        val name = impl.name()
        registered[name] = impl
        KreuzbergBridge.nativeRegisterValidator(impl)
    }

    fun unregister(name: String): Unit {
        registered.remove(name)
        KreuzbergBridge.nativeUnregisterValidator(name)
    }

    fun clearAll(): Unit {
        registered.clear()
        KreuzbergBridge.nativeClearValidators()
    }

    fun getAll(): Map<String, IValidator> = registered.toMap()
}
