Reflection to check supported by driver api versions
This commit is contained in:
parent
ba11a41dc9
commit
6f5a21e621
@ -0,0 +1,24 @@
|
||||
package ru.landgrafhomyak.db.skeleton1.api
|
||||
|
||||
import kotlin.jvm.JvmField
|
||||
|
||||
public abstract class ApiVersion private constructor(public val str: String) {
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (other == null) return false
|
||||
if (other !is ApiVersion) return false
|
||||
return this === other
|
||||
}
|
||||
|
||||
override fun toString(): String = "<db-skeleton api version '${this.str}'>"
|
||||
|
||||
override fun hashCode(): Int = this.str.hashCode()
|
||||
|
||||
public abstract fun isImplements(lower: ApiVersion): Boolean
|
||||
|
||||
public companion object {
|
||||
@JvmField
|
||||
public val V_0_0: ApiVersion = object : ApiVersion("0.0") {
|
||||
override fun isImplements(lower: ApiVersion) = this === lower
|
||||
}
|
||||
}
|
||||
}
|
@ -14,4 +14,5 @@ public interface DriverMetainfo<
|
||||
@Suppress("unused") STATEMENT_CONSTRUCTOR__PARAMS_2_TABLE : RawStatement.Params2Table.Constructor<*>,
|
||||
@Suppress("unused") OBJECT_OPERATIONS : ObjectOperations<*>
|
||||
> {
|
||||
public val apiVersion: ApiVersion
|
||||
}
|
Loading…
Reference in New Issue
Block a user