package Ġchat . sphinx . feature _ socket _ io . json Ċ Ċ import Ġchat . sphinx . concept _ network _ query _ chat . model . Chat Dto Ċ import Ġchat . sphinx . concept _ network _ query _ contact . model . Contact Dto Ċ import Ġchat . sphinx . concept _ network _ query _ invite . model . Invite Dto Ċ import Ġchat . sphinx . concept _ network _ query _ lightning . model . invoice . Lightning Payment Invoice Dto Ċ import Ġchat . sphinx . concept _ network _ query _ message . model . Message Dto Ċ import Ġchat . sphinx . concept _ socket _ io . Group Dto Ċ import Ġcom . squareup . mos hi . Json Class Ċ import Ġcom . squareup . mos hi . Json DataException Ċ import Ġcom . squareup . mos hi . M oshi Ċ import Ġjava . io . IOException ĊĊ Ċ @ Suppress (" NOTH ING _ TO _ INLINE ") Ċ @ Throws ( IOException :: class , ĠJson DataException :: class ) Ċ internal Ġinline Ġfun < T : ĠAny , ĠV : ĠMessage Response < T >> ĠM oshi . getMessage Response ( ĊĠĠĠ Ġadapter : ĠClass < V >, ĊĠĠĠ Ġjson : ĠString Ċ ): ĠT Ġ{ ĊĠĠĠ Ġval Ġjson Resolved : ĠString Ġ= Ġif Ġ( ĊĠĠĠĠĠĠĠ Ġadapter Ġ== ĠMessage Response . Response Group :: class . java Ġ&& ĊĠĠĠĠĠĠĠ Ġjson . contains ("\" contact \": {} ") ĊĠĠĠ Ġ) Ġ{ ĊĠĠĠĠĠĠĠ Ġjson . replace ("\" contact \": {}", Ġ"\" contact \": null ") ĊĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠ Ġjson ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġreturn Ġadapter ( adapter ) ĊĠĠĠĠĠĠĠ Ġ. fromJson ( json Resolved ) ĊĠĠĠĠĠĠĠ Ġ? . response ĊĠĠĠĠĠĠĠ Ġ?: Ġthrow ĠJson DataException (" Failed Ġto Ġconvert ĠSocket IO ĠMessage . response ĠJson Ġto Ġ${ adapter . simple Name }") Ċ } Ċ Ċ @ Json Class ( generate Adapter Ġ= Ġtrue ) Ċ internal Ġdata Ġclass ĠGroup Dto Impl ( ĊĠĠĠ Ġoverride Ġval Ġchat : ĠChat Dto , ĊĠĠĠ Ġoverride Ġval Ġcontact : ĠContact Dto ?, ĊĠĠĠ Ġoverride Ġval Ġmessage : ĠMessage Dto Ċ ): ĠGroup Dto () Ċ Ċ internal Ġsealed Ġclass ĠMessage Response < T > Ġ{ ĊĠĠĠ Ġabstract Ġval Ġresponse : ĠT ĊĊĠĠĠ Ġ@ Json Class ( generate Adapter Ġ= Ġtrue ) ĊĠĠĠ Ġinternal Ġclass ĠResponse Chat ( override Ġval Ġresponse : ĠChat Dto ): ĠMessage Response < Chat Dto >() ĊĊĠĠĠ Ġ@ Json Class ( generate Adapter Ġ= Ġtrue ) ĊĠĠĠ Ġinternal Ġclass ĠResponse Contact ( override Ġval Ġresponse : ĠContact Dto ): ĠMessage Response < Contact Dto >() ĊĊĠĠĠ Ġ@ Json Class ( generate Adapter Ġ= Ġtrue ) ĊĠĠĠ Ġinternal Ġclass ĠResponse Group ( override Ġval Ġresponse : ĠGroup Dto Impl ): ĠMessage Response < Group Dto Impl >() ĊĊĠĠĠ Ġ@ Json Class ( generate Adapter Ġ= Ġtrue ) ĊĠĠĠ Ġinternal Ġclass ĠResponse Invite ( override Ġval Ġresponse : ĠInv ite Dto ): ĠMessage Response < Invite Dto >() ĊĊĠĠĠ Ġ@ Json Class ( generate Adapter Ġ= Ġtrue ) ĊĠĠĠ Ġinternal Ġclass ĠResponse Invoice ( override Ġval Ġresponse : ĠLight ning Payment Invoice Dto ): ĠMessage Response < Lightning Payment Invoice Dto >() ĊĊĠĠĠ Ġ@ Json Class ( generate Adapter Ġ= Ġtrue ) ĊĠĠĠ Ġinternal Ġclass ĠResponse Message ( override Ġval Ġresponse : ĠMessage Dto ): ĠMessage Response < Message Dto >() Ċ } ĊĊ