2019-11-23 21:16:03 +01:00
|
|
|
package org.mercury_im.messenger.data.di;
|
|
|
|
|
|
|
|
import org.mercury_im.messenger.data.mapping.AccountMapping;
|
|
|
|
import org.mercury_im.messenger.data.mapping.DirectChatMapping;
|
|
|
|
import org.mercury_im.messenger.data.mapping.PeerMapping;
|
|
|
|
|
|
|
|
import javax.inject.Singleton;
|
|
|
|
|
|
|
|
import dagger.Module;
|
|
|
|
import dagger.Provides;
|
|
|
|
|
|
|
|
@Module
|
|
|
|
public class MappingModule {
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
@Singleton
|
|
|
|
public static AccountMapping accountMapping() {
|
|
|
|
return new AccountMapping();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
@Singleton
|
|
|
|
public static PeerMapping peerMapping() {
|
2019-12-01 19:56:13 +01:00
|
|
|
return new PeerMapping(accountMapping());
|
2019-11-23 21:16:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
@Singleton
|
|
|
|
public static DirectChatMapping directChatMapping() {
|
2019-12-01 21:16:01 +01:00
|
|
|
return new DirectChatMapping(peerMapping());
|
2019-11-23 21:16:03 +01:00
|
|
|
}
|
|
|
|
}
|