/* Ċ Ġ* Ġ( c ) ĠCopyright Ġ 2 0 1 9 ĠGl ade ĠDiv ine y . Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ package Ġutil Ċ Ċ import Ġio . gl aded . watch able . Watch able List Ċ import Ġio . gl aded . watch able . to Watch able List Ċ import Ġkotlinx . serialization . Experimental Serialization Api Ċ import Ġkotlinx . serialization . K Serializer Ċ import Ġkotlinx . serialization . Serializer Ċ import Ġkotlinx . serialization . builtins . List Serializer Ċ import Ġkotlinx . serialization . descriptors . Serial Descriptor Ċ import Ġkotlinx . serialization . descriptors . build Class Serial Descriptor Ċ import Ġkotlinx . serialization . descriptors . list Serial Descriptor Ċ import Ġkotlinx . serialization . encoding . Decoder Ċ import Ġkotlinx . serialization . encoding . Encoder Ċ Ċ @ Opt In ( Experimental Serialization Api :: class ) Ċ @ Serializer ( for Class Ġ= ĠWatch able List :: class ) Ċ class ĠWatch able List Serializer < T Ġ: ĠAny >( value Serializer : ĠK Serializer < T >) Ġ: ĠK Serializer < Watch able List < T >> Ġ{ ĊĠĠĠ Ġoverride Ġval Ġdescriptor : ĠSerial Descriptor Ġ= Ġbuild Class Serial Descriptor (" Watch able List ") Ġ{ ĊĠĠĠĠĠĠĠ Ġlist Serial Descriptor ( value Serializer . descriptor ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġval Ġlist Serializer Ġ= ĠList Serializer ( value Serializer ) ĊĊĠĠĠ Ġoverride Ġfun Ġserialize ( encoder : ĠEncoder , Ġvalue : ĠWatch able List < T >) Ġ{ ĊĠĠĠĠĠĠĠ Ġlist Serializer . serialize ( encoder , Ġvalue ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġdeserialize ( decoder : ĠDecoder ): ĠWatch able List < T > Ġ= ĊĠĠĠĠĠĠĠ Ġlist Serializer . deserialize ( decoder ). to Watch able List () Ċ } Ċ