added Kdoc

This commit is contained in:
sonalyadav 2025-05-28 09:44:02 +05:30
parent 5269327f40
commit b81fb11ceb

View file

@ -131,10 +131,22 @@ class UploadPresenter @Inject internal constructor(
basicKvStoreFactory = factory basicKvStoreFactory = factory
} }
/**
* Returns the current BasicKvStore factory or throws if not initialized.
*
* @throws IllegalStateException if basicKvStoreFactory has not been initialized.
*/
private fun getBasicKvStoreFactory(): (String) -> BasicKvStore { private fun getBasicKvStoreFactory(): (String) -> BasicKvStore {
return basicKvStoreFactory ?: throw IllegalStateException("basicKvStoreFactory has not been initialized") return basicKvStoreFactory ?: throw IllegalStateException("basicKvStoreFactory has not been initialized")
} }
/**
* Ensures that the BasicKvStore factory has been initialized before use.
*
* @throws IllegalStateException if the factory is null.
*/
private fun requireFactoryInitialized() { private fun requireFactoryInitialized() {
val field = this::class.java.getDeclaredField("basicKvStoreFactory") val field = this::class.java.getDeclaredField("basicKvStoreFactory")
field.isAccessible = true field.isAccessible = true