com.papsign.ktor.openapigen.SchemaMap.kt Maven / Gradle / Ivy
@file:Suppress("UNCHECKED_CAST")
package com.papsign.ktor.openapigen
import com.papsign.ktor.openapigen.model.schema.SchemaModel
import kotlin.reflect.KType
typealias SchemaMap = Map>
typealias MutableSchemaMap = MutableMap>
typealias LinkedHashSchemaMap = LinkedHashMap>
typealias HashSchemaMap = HashMap>
inline fun SchemaMap.get(): SchemaModel? {
return get(getKType()) as SchemaModel?
}
inline fun SchemaMap.containsKey(): Boolean {
return containsKey(getKType())
}
inline fun MutableSchemaMap.put(value: SchemaModel): SchemaModel? {
return put(getKType(), value) as SchemaModel?
}
inline fun MutableSchemaMap.remove(): SchemaModel? {
return remove(getKType()) as SchemaModel?
}