io.lenses.jdbc4.IWrapper.kt Maven / Gradle / Ivy
package io.lenses.jdbc4
import java.sql.SQLException
interface IWrapper {
fun _isWrapperFor(iface: Class<*>?): Boolean = iface?.isInstance(iface) ?: false
fun _unwrap(iface: Class): T {
try {
return iface.cast(this)
} catch (cce: ClassCastException) {
throw SQLException("Unable to unwrap instance as $iface")
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy