Skip to content

Instantly share code, notes, and snippets.

@stella6767
Created August 18, 2022 02:40
Show Gist options
  • Save stella6767/25db06a04291875fba0635e0471b06d5 to your computer and use it in GitHub Desktop.
Save stella6767/25db06a04291875fba0635e0471b06d5 to your computer and use it in GitHub Desktop.
staticFactoryMethodWithKotlin
interface QuerryRunner {
fun getInstance(): QueryRunnerFactory
}
class QueryRunnerFactory(
) : QuerryRunner {
companion object Factory {
var queryRunner = QueryRunnerFactory()
fun createRunner(): QueryRunnerFactory {
return QueryRunnerFactory()
}
fun getRunnerInstance(): QueryRunnerFactory {
return queryRunner
}
}
override fun getInstance(): QueryRunnerFactory {
return getRunnerInstance()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment