package Ġcom . z ae em . my application . data . local Cache Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroidx . room . Database Ċ import Ġandroidx . room . Room Ċ import Ġandroidx . room . Room Database Ċ import Ġcom . z ae em . my application . data . local Cache . dao . Con versations Dao Ċ import Ġcom . z ae em . my application . data . local Cache . dao . Messages Dao Ċ import Ġcom . z ae em . my application . data . local Cache . dao . Participants Dao Ċ import Ġcom . z ae em . my application . data . local Cache . entity . Conversation Data Item Ċ import Ġcom . z ae em . my application . data . local Cache . entity . Message Data Item Ċ import Ġcom . z ae em . my application . data . local Cache . entity . Participant Data Item Ċ Ċ @ Database ( entities Ġ= Ġ[ Conversation Data Item :: class , ĠMessage Data Item :: class , ĠPart icipant Data Item :: class ], Ġversion Ġ= Ġ 1 , Ġexport Schema Ġ= Ġfalse ) Ċ abstract Ġclass ĠLocal Cache Provider Ġ: ĠRoom Database () Ġ{ ĊĊĠĠĠ Ġabstract Ġfun Ġconversations Dao (): ĠCon versations Dao ĊĊĠĠĠ Ġabstract Ġfun Ġmessages Dao (): ĠMessages Dao ĊĊĠĠĠ Ġabstract Ġfun Ġparticipants Dao (): ĠPart icipants Dao ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġval ĠINSTANCE Ġget () Ġ= Ġ_ instance Ġ?: Ġerror (" call ĠLocal Cache Provider . create Instance () Ġfirst ") ĊĊĠĠĠĠĠĠĠ Ġprivate Ġvar Ġ_ instance : ĠLocal Cache Provider ? Ġ= Ġnull ĊĊĠĠĠĠĠĠĠ Ġfun Ġcreate Instance ( context : ĠContext ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcheck (_ instance Ġ== Ġnull ) Ġ{ Ġ" Local Cache Provider Ġsingleton Ġinstance Ġhas Ġbeen Ġalready Ġcreated " Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ_ instance Ġ= ĠRoom . in Memory Database Builder ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcontext . application Context , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠLocal Cache Provider :: class . java ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ). build () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ