package Ġcom . a ibb . android . demo . sun flower . data . repository Ċ Ċ import Ġcom . a ibb . android . demo . sun flower . data . dao . G arden Plant ing Dao Ċ import Ġcom . a ibb . android . demo . sun flower . data . pojo . G arden Plant ing Ċ Ċ /** Ċ Ġ* ĠCopyright : ĠĠ ĠCopyright Ġ( c ) Ġ ĠAll Ġrights Ġreserved .< br > Ċ Ġ* ĠAuthor : ĠĠĠĠĠ Ġa ib ing bing Ġ< br > Ċ Ġ* ĠDate : ĠĠĠĠĠĠĠĠ 2 0 2 0 / 9 / 8 Ġ< br > Ċ Ġ* ĠDesc : ĠĠĠĠĠĠĠ Ġ< br > Ċ Ġ*/ Ċ class ĠG arden Plant ing Repository Ġprivate Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġg arden Plant ing Dao : ĠG arden Plant ing Dao Ċ ) Ġ{ ĊĠĠĠ Ġsuspend Ġfun Ġcreate G arden Plant ing ( plant Id : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġg arden Plant ing Ġ= ĠG arden Plant ing ( plant Id ) ĊĠĠĠĠĠĠĠ Ġg arden Plant ing Dao . insert G arden Plant ing ( g arden Plant ing ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġremove G arden Plant ing ( g arden Plant ing : ĠG arden Plant ing ) Ġ{ ĊĠĠĠĠĠĠĠ Ġg arden Plant ing Dao . delete G arden Plant ing ( g arden Plant ing ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġis Pl anted ( plant Id : ĠString ) Ġ= ĊĠĠĠĠĠĠĠ Ġg arden Plant ing Dao . is Pl anted ( plant Id ) ĊĊĠĠĠ Ġfun Ġget Pl anted G ard ens () Ġ= Ġg arden Plant ing Dao . get Pl anted G ard ens () ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġ@ Volatile ĊĠĠĠĠĠĠĠ Ġprivate Ġvar Ġinstance : ĠG arden Plant ing Repository ? Ġ= Ġnull ĊĊĠĠĠĠĠĠĠ Ġfun ĠgetInstance ( g arden Plant ing Dao : ĠG arden Plant ing Dao ) Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġinstance Ġ?: Ġsynchronized ( this ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinstance Ġ?: ĠG arden Plant ing Repository ( g arden Plant ing Dao ). also Ġ{ Ġinstance Ġ= Ġit Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } ĊĊ