package Ġes . plex us . android . mar vel pedia . datal ayer . di Ċ Ċ import Ġcom . jak ew h art on . ret rofit 2 . adapter . kotlin . coroutines . Coroutine Call Adapter Factory Ċ import Ġcom . squareup . mos hi . M oshi Ċ import Ġcom . squareup . mos hi . kotlin . reflect . Kotlin Json Adapter Factory Ċ import Ġes . plex us . android . mar vel pedia . datal ayer . datasource . Android DataSource Ċ import Ġes . plex us . android . mar vel pedia . datal ayer . datasource . Connectivity DataSource Ċ import Ġes . plex us . android . mar vel pedia . datal ayer . datasource . Connectivity DataSource . Companion . CONNECT IVITY _ DATA _ SOURCE _ TAG Ċ import Ġes . plex us . android . mar vel pedia . datal ayer . datasource . Mar vel DataSource Ċ import Ġes . plex us . android . mar vel pedia . datal ayer . datasource . Characters DataSource Ċ import Ġes . plex us . android . mar vel pedia . datal ayer . datasource . Characters DataSource . Companion . CHAR ACT ERS _ API _ SERVICE _ TAG Ċ import Ġes . plex us . android . mar vel pedia . datal ayer . datasource . Characters DataSource . Companion . CHAR ACT ERS _ DATA _ SOURCE _ TAG Ċ import Ġes . plex us . android . mar vel pedia . datal ayer . datasource . Characters DataSource . Companion . CHAR ACT ERS _ BASE _ URL Ċ import Ġes . plex us . android . mar vel pedia . datal ayer . repository . Repository Ċ import Ġes . plex us . android . mar vel pedia . datal ayer . utils . Connectivity Interceptor Ċ import Ġes . plex us . android . mar vel pedia . datal ayer . utils . Connectivity Interceptor . Companion . CONNECT IVITY _ INTER CEPT OR _ TAG Ċ import Ġes . plex us . android . mar vel pedia . domain layer . Domain layer Contract Ċ import Ġes . plex us . android . mar vel pedia . domain layer . Domain layer Contract . D atal ayer . Companion . DATA _ REPOSITORY _ TAG Ċ import Ġes . plex us . android . mar vel pedia . domain layer . domain . Character Data Bo Wrapper Ċ import Ġokhttp 3 . Interceptor Ċ import Ġokhttp 3 . Ok HttpClient Ċ import Ġorg . k oin . android . ext . k oin . android Context Ċ import Ġorg . k oin . core . qual ifier . named Ċ import Ġorg . k oin . dsl . module Ċ import Ġretrofit 2 . Ret rofit Ċ import Ġretrofit 2 . converter . mos hi . M oshi Converter Factory Ċ import Ġjava . util . concurrent . TimeUnit Ċ Ċ private Ġconst Ġval ĠCONNECTION _ TIMEOUT Ġ= Ġ 2 0 L Ċ private Ġconst Ġval ĠREAD _ TIMEOUT Ġ= Ġ 3 0 L Ċ Ċ /** Ċ Ġ* ĠThis Ġvariable Ġrepresents Ġthe Ġ' data - layer ' Ġdependencies Ġmodule Ġto Ġbe Ġused Ġby ĠK oin . ĠIt Ġbasically Ċ Ġ* Ġincludes Ġrepository Ġand Ġdata - source Ġdefinitions . Ċ Ġ* Ċ Ġ* Ġ@ since Ġ 1 . 0 Ċ Ġ*/ Ċ val Ġdata Layer Module Ġ= Ġmodule ( override Ġ= Ġtrue ) Ġ{ ĊĠĠĠ Ġ// Ġrepository ĊĠĠĠ Ġsingle Ġ{ ĊĠĠĠĠĠĠĠ ĠRepository . apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġconnectivity DataSource Ġ= Ġget ( named ( name Ġ= ĠCONNECT IVITY _ DATA _ SOURCE _ TAG )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcharacters DataSource Ġ= Ġget ( named ( name Ġ= ĠCHAR ACT ERS _ DATA _ SOURCE _ TAG )) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠĠĠ Ġsingle < Domain layer Contract . D atal ayer . Data Repository < Character Data Bo Wrapper >>( named ( name Ġ= ĠDATA _ REPOSITORY _ TAG )) Ġ{ ĊĠĠĠĠĠĠĠ Ġget < Repository >() ĊĠĠĠ Ġ} ĊĠĠĠ Ġ// Ġdata - source ĊĠĠĠ Ġfactory < Connectivity DataSource >( named ( name Ġ= ĠCONNECT IVITY _ DATA _ SOURCE _ TAG )) Ġ{ ĊĠĠĠĠĠĠĠ ĠAndroid DataSource ( context Ġ= Ġandroid Context ()) ĊĠĠĠ Ġ} ĊĠĠĠ Ġfactory < Characters DataSource >( named ( name Ġ= ĠCHAR ACT ERS _ DATA _ SOURCE _ TAG )) Ġ{ ĊĠĠĠĠĠĠĠ ĠMar vel DataSource ( get ( named ( name Ġ= ĠCHAR ACT ERS _ API _ SERVICE _ TAG ))) ĊĠĠĠ Ġ} ĊĠĠĠ Ġfactory < Interceptor >( named ( name Ġ= ĠCONNECT IVITY _ INTER CEPT OR _ TAG )) Ġ{ ĊĠĠĠĠĠĠĠ ĠConnect ivity Interceptor ( get ( named ( name Ġ= ĠCONNECT IVITY _ DATA _ SOURCE _ TAG ))) ĊĠĠĠ Ġ} ĊĠĠĠ Ġfactory < Ok HttpClient > Ġ{ ĊĠĠĠĠĠĠĠ ĠOk HttpClient . Builder () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. connect Timeout ( CONNECTION _ TIMEOUT , ĠTimeUnit . SECONDS ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. read Timeout ( READ _ TIMEOUT , ĠTimeUnit . SECONDS ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. add Interceptor ( get ( named ( name Ġ= ĠCONNECT IVITY _ INTER CEPT OR _ TAG ))) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠ Ġ} ĊĠĠĠ Ġ// Ġretrofit ĊĠĠĠ Ġsingle < Ret rofit >( named ( name Ġ= ĠCHAR ACT ERS _ API _ SERVICE _ TAG )) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġm oshi Ġ= ĠM oshi . Builder (). add ( Kotlin Json Adapter Factory ()). build () ĊĠĠĠĠĠĠĠ ĠRet rofit . Builder () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. add Converter Factory ( M oshi Converter Factory . create ( mos hi )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. add Call Adapter Factory ( Coroutine Call Adapter Factory ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. client ( get ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. baseUrl ( CHAR ACT ERS _ BASE _ URL ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠ Ġ} Ċ } Ċ