I'm using Dagger @Binds to binding the interface ...
# dagger
p
I'm using Dagger @Binds to binding the interface to implementation. I have genric mapper which transform one object to other.
Copy code
interface DataMapper<T, R> {
     fun transform(from: T): R
 }
So I have couple of Data mapper in each use case layer . Let's I have something like this
Copy code
class AccountDataMapper @Inject constructor():
DataMapper<Account,Result<Account>>{
override fun transform(account : Account){
}
}
How can I bind this. I have many mapper in the like Login Mapper,User mapper. When I use thr binder it's complaining that @Binds method parameter type must be assignable to the return type @Binds
abstract fun bindAccountMapper(mapper AccountDataMapper) : DataMapper<Account,Result<Account>>
Thanks in advance
r
Looks fine, maybe check your imports? You might have imported wrong
Result<>
class
p
Ya might be .. 😭 this one annoys me a lot. Let me double check .. thanks bro