package Ġcom . j aa . library . domain . repository Ċ Ċ import Ġcom . j aa . library . domain . dataSource . memory . Film Memory Storage Interface Ċ import Ġcom . j aa . library . domain . dataSource . storage . Film Database Interface Ċ import Ġdev . icer ock . mo ko . network . generated . models . Film Data Ċ Ċ interface ĠLocal Database Manager Repository Ġ{ ĊĠĠĠ Ġval Ġfilm Database : ĠFil m Database Interface ĊĠĠĠ Ġval Ġfilm Memory Storage : ĠFil m Memory Storage Interface ĊĊĠĠĠ Ġfun Ġupdate Film ( film : ĠFil m Data ) Ġ{ ĊĠĠĠĠĠĠĠ Ġsynchronize Local Data Sources () ĊĠĠĠĠĠĠĠ Ġfilm Memory Storage . update Film ( film ) ĊĠĠĠĠĠĠĠ Ġfilm Database . update Film ( film ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġsynchronize Local Data Sources () Ġ{ ĊĠĠĠĠĠĠĠ Ġfilm Memory Storage . save Film List ( film Database . get Film List With Local Offset ( 0 , Ġfilm Memory Storage . get Film List (). size )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Film ( title : String ): ĠFil m Data ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġtry Ġ{ film Memory Storage . get Film List (). first Ġ{ Ġit . title Ġ== Ġtitle Ġ}} Ġcatch Ġ( e : NoSuch ElementException ) Ġ{ Ġnull Ġ} ĊĠĠĠ Ġ} Ċ Ċ }