package Ġorg . buffer . android . boilerplate . presentation . browse Ċ Ċ import Ġandroid . arch . lifecycle . ViewModel Ċ import Ġandroid . arch . lifecycle . ViewModel Provider Ċ import Ġorg . buffer . android . boilerplate . domain . inter actor . browse . Get Buffer o os Ċ import Ġorg . buffer . android . boilerplate . presentation . mapper . Buffer oo Mapper Ċ Ċ open Ġclass ĠB rowse Buffer o os ViewModel Factory ( ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġget Buffer o os : ĠGet Buffer o os , ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġbuffer oo Mapper : ĠBuffer oo Mapper ) Ġ: ĠViewModel Provider . Factory Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġ< T Ġ: ĠViewModel > Ġcreate ( model Class : ĠClass < T >): ĠT Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( model Class . isAssignableFrom ( Browse Buffer o os ViewModel :: class . java )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠB rowse Buffer o os ViewModel ( get Buffer o os , Ġbuffer oo Mapper ) Ġas ĠT ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġthrow ĠIllegalArgumentException (" Unknown ĠViewModel Ġclass ") ĊĠĠĠ Ġ} Ċ }