// ĠCode Ġgenerated Ġby Ġm oshi - kotlin - codegen . ĠDo Ġnot Ġedit . Ċ @ file : Suppress (" DE PREC ATION ", Ġ" unused ", Ġ" ClassName ", Ġ" RED UND ANT _ PRO JECTION ", ĊĠĠĠ Ġ" Red undant Explicit Type ", Ġ" Local Variable Name ", Ġ" Red undant Visibility Modifier ", ĊĠĠĠ Ġ" PLATFORM _ CLASS _ MAP PED _ TO _ K OT LIN ", Ġ" IMP LICIT _ NOTH ING _ TYPE _ ARGUMENT _ IN _ RETURN _ POSITION ") Ċ Ċ package Ġcom . example . android . dev byte viewer . network Ċ Ċ import Ġcom . squareup . mos hi . Json Adapter Ċ import Ġcom . squareup . mos hi . Json Reader Ċ import Ġcom . squareup . mos hi . Json Writer Ċ import Ġcom . squareup . mos hi . M oshi Ċ import Ġcom . squareup . mos hi .` internal `. Util Ċ import Ġjava . lang . NullPointerException Ċ import Ġkotlin . String Ċ import Ġkotlin . Suppress Ċ import Ġkotlin . Unit Ċ import Ġkotlin . collections . empty Set Ċ import Ġkotlin . text . build String Ċ Ċ public Ġclass ĠNetwork Video Json Adapter ( ĊĠ Ġm oshi : ĠM oshi Ċ ) Ġ: ĠJson Adapter < Network Video >() Ġ{ ĊĠ Ġprivate Ġval Ġoptions : ĠJson Reader . Options Ġ= ĠJson Reader . Options . of (" title ", Ġ" description ", Ġ" url ", ĊĠĠĠĠĠ Ġ" updated ", Ġ" thumbnail ", Ġ" closed Capt ions ") ĊĊĠ Ġprivate Ġval Ġstring Adapter : ĠJson Adapter < String > Ġ= Ġm oshi . adapter ( String :: class . java , Ġempty Set (), ĊĠĠĠĠĠ Ġ" title ") ĊĊĠ Ġprivate Ġval Ġnullable String Adapter : ĠJson Adapter < String ?> Ġ= Ġm oshi . adapter ( String :: class . java , ĊĠĠĠĠĠ Ġempty Set (), Ġ" closed Capt ions ") ĊĊĠ Ġpublic Ġoverride Ġfun ĠtoString (): ĠString Ġ= Ġbuild String ( 3 4 ) Ġ{ ĊĠĠĠĠĠ Ġappend (" Generated Json Adapter (" ). append (" Network Video "). append (' )') Ġ} ĊĊĠ Ġpublic Ġoverride Ġfun Ġfrom Json ( reader : ĠJson Reader ): ĠNetwork Video Ġ{ ĊĠĠĠ Ġvar Ġtitle : ĠString ? Ġ= Ġnull ĊĠĠĠ Ġvar Ġdescription : ĠString ? Ġ= Ġnull ĊĠĠĠ Ġvar Ġurl : ĠString ? Ġ= Ġnull ĊĠĠĠ Ġvar Ġupdated : ĠString ? Ġ= Ġnull ĊĠĠĠ Ġvar Ġthumbnail : ĠString ? Ġ= Ġnull ĊĠĠĠ Ġvar Ġclosed Capt ions : ĠString ? Ġ= Ġnull ĊĠĠĠ Ġreader . begin Object () ĊĠĠĠ Ġwhile Ġ( reader . hasNext ()) Ġ{ ĊĠĠĠĠĠ Ġwhen Ġ( reader . select Name ( options )) Ġ{ ĊĠĠĠĠĠĠĠĠ 0 Ġ-> Ġtitle Ġ= Ġstring Adapter . fromJson ( reader ) Ġ?: Ġthrow ĠUtil . unexpected Null (" title ", Ġ" title ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreader ) ĊĠĠĠĠĠĠĠĠ 1 Ġ-> Ġdescription Ġ= Ġstring Adapter . fromJson ( reader ) Ġ?: ĊĠĠĠĠĠĠĠĠĠĠĠ Ġthrow ĠUtil . unexpected Null (" description ", Ġ" description ", Ġreader ) ĊĠĠĠĠĠĠĠĠ 2 Ġ-> Ġurl Ġ= Ġstring Adapter . fromJson ( reader ) Ġ?: Ġthrow ĠUtil . unexpected Null (" url ", Ġ" url ", Ġreader ) ĊĠĠĠĠĠĠĠĠ 3 Ġ-> Ġupdated Ġ= Ġstring Adapter . fromJson ( reader ) Ġ?: Ġthrow ĠUtil . unexpected Null (" updated ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" updated ", Ġreader ) ĊĠĠĠĠĠĠĠĠ 4 Ġ-> Ġthumbnail Ġ= Ġstring Adapter . fromJson ( reader ) Ġ?: Ġthrow ĠUtil . unexpected Null (" thumbnail ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" thumbnail ", Ġreader ) ĊĠĠĠĠĠĠĠĠ 5 Ġ-> Ġclosed Capt ions Ġ= Ġnullable String Adapter . fromJson ( reader ) ĊĠĠĠĠĠĠĠ Ġ- 1 Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġ// ĠUnknown Ġname , Ġskip Ġit . ĊĠĠĠĠĠĠĠĠĠ Ġreader . skip Name () ĊĠĠĠĠĠĠĠĠĠ Ġreader . skip Value () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠĠĠ Ġreader . end Object () ĊĠĠĠ Ġreturn ĠNetwork Video ( ĊĠĠĠĠĠĠĠ Ġtitle Ġ= Ġtitle Ġ?: Ġthrow ĠUtil . missing Property (" title ", Ġ" title ", Ġreader ), ĊĠĠĠĠĠĠĠ Ġdescription Ġ= Ġdescription Ġ?: Ġthrow ĠUtil . missing Property (" description ", Ġ" description ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreader ), ĊĠĠĠĠĠĠĠ Ġurl Ġ= Ġurl Ġ?: Ġthrow ĠUtil . missing Property (" url ", Ġ" url ", Ġreader ), ĊĠĠĠĠĠĠĠ Ġupdated Ġ= Ġupdated Ġ?: Ġthrow ĠUtil . missing Property (" updated ", Ġ" updated ", Ġreader ), ĊĠĠĠĠĠĠĠ Ġthumbnail Ġ= Ġthumbnail Ġ?: Ġthrow ĠUtil . missing Property (" thumbnail ", Ġ" thumbnail ", Ġreader ), ĊĠĠĠĠĠĠĠ Ġclosed Capt ions Ġ= Ġclosed Capt ions ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġpublic Ġoverride Ġfun ĠtoJson ( writer : ĠJson Writer , Ġvalue _: ĠNetwork Video ?): ĠUnit Ġ{ ĊĠĠĠ Ġif Ġ( value _ Ġ== Ġnull ) Ġ{ ĊĠĠĠĠĠ Ġthrow ĠNullPointerException (" value _ Ġwas Ġnull ! ĠWrap Ġin Ġ. null Safe () Ġto Ġwrite Ġnullable Ġvalues .") ĊĠĠĠ Ġ} ĊĠĠĠ Ġwriter . begin Object () ĊĠĠĠ Ġwriter . name (" title ") ĊĠĠĠ Ġstring Adapter . toJson ( writer , Ġvalue _. title ) ĊĠĠĠ Ġwriter . name (" description ") ĊĠĠĠ Ġstring Adapter . toJson ( writer , Ġvalue _. description ) ĊĠĠĠ Ġwriter . name (" url ") ĊĠĠĠ Ġstring Adapter . toJson ( writer , Ġvalue _. url ) ĊĠĠĠ Ġwriter . name (" updated ") ĊĠĠĠ Ġstring Adapter . toJson ( writer , Ġvalue _. updated ) ĊĠĠĠ Ġwriter . name (" thumbnail ") ĊĠĠĠ Ġstring Adapter . toJson ( writer , Ġvalue _. thumbnail ) ĊĠĠĠ Ġwriter . name (" closed Capt ions ") ĊĠĠĠ Ġnullable String Adapter . toJson ( writer , Ġvalue _. closed Capt ions ) ĊĠĠĠ Ġwriter . end Object () ĊĠ Ġ} Ċ } Ċ