main.app.cash.backfila.client.misk.hibernate.PrimaryKeyCursorAdapterModule.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of client-misk-hibernate Show documentation
Show all versions of client-misk-hibernate Show documentation
Backfila is a service that manages backfill state, calling into other services to do batched work.
The newest version!
package app.cash.backfila.client.misk.hibernate
import com.google.inject.AbstractModule
import com.google.inject.TypeLiteral
import com.google.inject.multibindings.MapBinder
class PrimaryKeyCursorAdapterModule(
private val primaryKeyType: Class,
private val primaryKeyCursorAdapter: PrimaryKeyCursorAdapter,
) : AbstractModule() {
override fun configure() {
MapBinder.newMapBinder(
binder(),
object : TypeLiteral>() {},
object : TypeLiteral>() {},
).addBinding(primaryKeyType)
.toInstance(primaryKeyCursorAdapter)
}
companion object {
inline fun create(
primaryKeyCursorAdapter: PrimaryKeyCursorAdapter,
): PrimaryKeyCursorAdapterModule {
return PrimaryKeyCursorAdapterModule(PK::class.java, primaryKeyCursorAdapter)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy