package Ġcom . mut l ak . metis . word mem . data . remote Ċ Ċ import Ġcom . facebook . ste tho . okhttp 3 . St eth o Interceptor Ċ import Ġcom . google . gson . Field Naming Policy Ċ import Ġcom . google . gson . Gson Ċ import Ġcom . google . gson . Gson Builder Ċ import Ġcom . mut l ak . metis . word mem . Build Config Ċ import Ġokhttp 3 . Ok HttpClient Ċ import Ġokhttp 3 . logging . Http Logging Interceptor Ċ import Ġretrofit 2 . Ret rofit Ċ import Ġretrofit 2 . adapter . rx java 2 . Rx Java 2 Call Adapter Factory Ċ import Ġretrofit 2 . converter . gson . Gson Converter Factory Ċ import Ġtim ber . log . Tim ber Ċ Ċ /** Ċ Ġ* ĠProvide Ġ" make " Ġmethods Ġto Ġcreate Ġinstances Ġof Ġ[ Mut l ak Service ] Ċ Ġ* Ġand Ġits Ġrelated Ġdependencies , Ġsuch Ġas ĠOk HttpClient , ĠGson , Ġetc . Ċ Ġ*/ Ċ object ĠM vp Starter Service Factory Ġ{ ĊĊĠ Ġfun Ġmake Starter Service (): ĠMut l ak Service Ġ{ ĊĠĠĠ Ġreturn Ġmake M vp Starter Service ( make Gson ()) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġmake M vp Starter Service ( gson : ĠGson ): ĠMut l ak Service Ġ{ ĊĠĠĠ Ġval Ġretrofit Ġ= ĠRet rofit . Builder () ĊĠĠĠĠĠĠĠ Ġ. baseUrl ( Build Config . API _ URL ) ĊĠĠĠĠĠĠĠ Ġ. client ( make Ok HttpClient ()) ĊĠĠĠĠĠĠĠ Ġ. add Converter Factory ( Gson Converter Factory . create ( gson )) ĊĠĠĠĠĠĠĠ Ġ. add Call Adapter Factory ( Rx Java 2 Call Adapter Factory . create ()) ĊĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠ Ġreturn Ġretrofit . create ( Mut l ak Service :: class . java ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġmake Ok HttpClient (): ĠOk HttpClient Ġ{ ĊĊĠĠĠ Ġval ĠhttpClient Builder Ġ= ĠOk HttpClient . Builder () ĊĊĠĠĠ Ġif Ġ( Build Config . DEBUG ) Ġ{ ĊĠĠĠĠĠ Ġval Ġlogging Interceptor Ġ= ĠHttp Logging Interceptor Ġ{ Ġmessage Ġ-> ĠTim ber . d ( message ) Ġ} ĊĠĠĠĠĠ Ġlogging Interceptor . level Ġ= ĠHttp Logging Interceptor . Level . BODY ĊĠĠĠĠĠ ĠhttpClient Builder . add Interceptor ( logging Interceptor ) ĊĠĠĠĠĠ ĠhttpClient Builder . add Network Interceptor ( St eth o Interceptor ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġreturn ĠhttpClient Builder . build () ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġmake Gson (): ĠGson Ġ{ ĊĠĠĠ Ġreturn ĠGson Builder () ĊĠĠĠĠĠĠĠ Ġ. set DateFormat (" yyyy - MM - dd ' T ' HH : mm : ss . SS S ' Z '") ĊĠĠĠĠĠĠĠ Ġ. setField Naming Policy ( Field Naming Policy . LOWER _ CASE _ WITH _ UNDER SCO RES ) ĊĠĠĠĠĠĠĠ Ġ. create () ĊĠ Ġ} Ċ } Ċ