package Ġcom . hello has an . ret rofit get request . feature . food _ list . model Ċ Ċ import Ġcom . hello has an . ret rofit get request . feature . food _ details . model . Food Ċ import Ġcom . hello has an . ret rofit get request . network . Food Api Interface Ċ import Ġcom . hello has an . ret rofit get request . network . Ret rofit Client Ċ import Ġretrofit 2 . Call Ċ import Ġretrofit 2 . Callback Ċ import Ġretrofit 2 . Response Ċ Ċ class ĠFood ListModel Impl : ĠFood ListModel Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġapi Interface Ġ= ĠRet rofit Client . getClient (). create ( Food Api Interface :: class . java ) ĊĠĠĠ Ġprivate Ġval Ġcall Ġ= Ġapi Interface . get Food List () ĊĊĠĠĠ Ġoverride Ġfun Ġget Food List ( food List Callback : ĠFood List Callback ) Ġ{ ĊĊĠĠĠĠĠĠĠ Ġcall . enqueue ( object Ġ: ĠCallback < Mutable List < Food >> { ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġfun Ġon Response ( call : ĠCall < Mutable List < Food >>, Ġresponse : ĠResponse < Mutable List < Food >>) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġresponse . body ()?. let Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġfood List Callback . on Success ( it ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġfun Ġon Failure ( call : ĠCall < Mutable List < Food >>, Ġt : ĠThrowable ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġfood List Callback . onError ( t ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠ Ġ} Ċ }