package Ġcom . chr yn an . android search . provider Ċ Ċ import Ġandroid . util . Patterns Ċ import Ġcom . chr yn an . android search . mapper . Email Mapper Ċ import Ġcom . chr yn an . android search . view model . Auto Complete Result ViewModel Ċ import Ġjavax . inject . Inject Ċ import Ġjavax . inject . Singleton Ċ Ċ @ Singleton Ċ class ĠEmail Provider Ġ@ Inject Ġconstructor ( private Ġval Ġmapper : ĠEmail Mapper ) Ġ: ĠQuery Result Provider < Auto Complete Result ViewModel . Email > Ġ{ ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĊĠĠĠĠĠĠĠ Ġprivate Ġval ĠE MAIL _ REGEX Ġ= ĠPattern s . EMAIL _ ADDRESS . to Regex () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġhandles Query ( query : ĠString ) Ġ= Ġquery . isNotBlank () Ġand ĠE MAIL _ REGEX . matches ( query ) ĊĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġquery ( query : ĠString ) Ġ= ĠlistOf ( mapper . map ( query )) Ċ }