package Ġde . met zg ore . be ansp lan . util . di . modules Ċ Ċ import Ġandroid . arch . persistence . room . Room Ċ import Ġandroid . content . Context Ċ import Ġdagger . Module Ċ import Ġdagger . Provides Ċ import Ġde . met zg ore . be ansp lan . data . room . Beans Plan Db Ċ import Ġde . met zg ore . be ansp lan . data . room . Schedule Room Dao Ċ import Ġjavax . inject . Singleton Ċ Ċ @ Module ( includes Ġ= Ġ[( Context Module :: class )]) Ċ class ĠSchedule Dao Module ( private Ġval Ġin Memory : ĠBoolean ) Ġ{ ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide Db ( context : ĠContext ) Ġ= Ġif Ġ( in Memory ) Ġ{ ĊĠĠĠĠĠĠĠ ĠRoom . in Memory Database Builder ( context , ĠBe ans Plan Db :: class . java ). build () ĊĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠ ĠRoom . database Builder ( context , ĠBe ans Plan Db :: class . java , Ġ" be ansp lan . db "). fallback To Dest ruct ive Migration (). build () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġfun Ġprovide Schedule Room Dao ( db : ĠBe ans Plan Db ): ĠSchedule Room Dao Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġdb . schedule Dao () ĊĠĠĠ Ġ} Ċ } Ċ