I'm using Dagger @Binds to binding the interface to implementation.
I have genric mapper which transform one object to other.
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
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