package Ġsite . peg asis . ta . fetch . modes . server . serializers Ċ Ċ import Ġorg . json . simple . JSONArray Ċ import Ġorg . json . simple . JSONObject Ċ import Ġsite . peg asis . ta . fetch . models . Course List Ċ import Ġsite . peg asis . ta . fetch . models . Time Line Ċ import Ġsite . peg asis . ta . fetch . modes . server . LATE ST _ API _ VERSION Ċ import Ġsite . peg asis . ta . fetch . modes . server . LATE ST _ PUBLIC _ API _ VERSION Ċ import Ġsite . peg asis . ta . fetch . modes . server . serializers . Course List Public Serializer V 1 . serialize Course List Ġas Ġserialize Public Course List V 1 Ċ import Ġsite . peg asis . ta . fetch . modes . server . serializers . Course List Public Serializer V 2 . serialize Course List Ġas Ġserialize Public Course List V 2 Ċ import Ġsite . peg asis . ta . fetch . modes . server . serializers . Course List Serializer V 1 0 . serialize Course List Ġas Ġserialize Course List V 1 0 Ċ import Ġsite . peg asis . ta . fetch . modes . server . serializers . Course List Serializer V 1 1 . serialize Course List Ġas Ġserialize Course List V 1 1 Ċ import Ġsite . peg asis . ta . fetch . modes . server . serializers . Course List Serializer V 1 2 . serialize Course List Ġas Ġserialize Course List V 1 2 Ċ import Ġsite . peg asis . ta . fetch . modes . server . serializers . Course List Serializer V 4 . serialize Course List Ġas Ġserialize Course List V 4 Ċ import Ġsite . peg asis . ta . fetch . modes . server . serializers . Course List Serializer V 5 . serialize Course List Ġas Ġserialize Course List V 5 Ċ import Ġsite . peg asis . ta . fetch . modes . server . serializers . Course List Serializer V 8 . serialize Course List Ġas Ġserialize Course List V 8 Ċ import Ġsite . peg asis . ta . fetch . modes . server . serializers . Time Line Serializer V 4 . serialize Time Line Ġas Ġserialize Time Line V 4 Ċ import Ġsite . peg asis . ta . fetch . modes . server . serializers . Time Line Serializer V 5 . serialize Time Line Ġas Ġserialize Time Line V 5 Ċ import Ġsite . peg asis . ta . fetch . modes . server . serializers . Time Line Serializer V 6 . serialize Time Line Ġas Ġserialize Time Line V 6 Ċ import Ġsite . peg asis . ta . fetch . modes . server . serializers . Time Line Serializer V 9 . serialize Time Line Ġas Ġserialize Time Line V 9 Ċ Ċ fun ĠJSONArray . wrap Version ( version : ĠInt ): ĠJSONObject Ġ{ ĊĠĠĠ Ġval Ġobj Ġ= ĠJSONObject () ĊĠĠĠ Ġobj [" version "] Ġ= Ġversion ĊĠĠĠ Ġobj [" data "] Ġ= Ġthis ĊĠĠĠ Ġreturn Ġobj Ċ } Ċ Ċ private Ġval ĠCourse List Serial izers Ġ= Ġmap Of < Int , Ġ( Course List ) Ġ-> ĠJSONArray >( ĊĠĠĠĠ 4 Ġto Ġ:: serialize Course List V 4 , ĊĠĠĠĠ 5 Ġto Ġ:: serialize Course List V 5 , ĊĠĠĠĠ 6 Ġto Ġ:: serialize Course List V 5 , ĊĠĠĠĠ 7 Ġto Ġ:: serialize Course List V 5 , ĊĠĠĠĠ 8 Ġto Ġ:: serialize Course List V 8 , ĊĠĠĠĠ 9 Ġto Ġ:: serialize Course List V 8 , ĊĠĠĠĠ 1 0 Ġto Ġ:: serialize Course List V 1 0 , ĊĠĠĠĠ 1 1 Ġto Ġ:: serialize Course List V 1 1 , ĊĠĠĠĠ 1 2 Ġto Ġ:: serialize Course List V 1 2 , ĊĠĠĠĠ 1 3 Ġto Ġ:: serialize Course List V 1 2 , Ċ ) Ċ Ċ fun ĠCourse List . serialize ( version : ĠInt Ġ= ĠL ATE ST _ API _ VERSION ): ĠJSONObject Ġ{ ĊĠĠĠ Ġval Ġserializer Ġ= ĠCourse List Serial izers [ version ] Ġ?: Ġerror (" Cannot Ġget Ġcourse Ġlist Ġserializer Ġfor ĠAPI ĠV $ version ") ĊĠĠĠ Ġval Ġjson Ġ= Ġserializer ( this ) ĊĠĠĠ Ġreturn Ġjson . wrap Version ( version ) Ċ } Ċ Ċ private Ġval ĠCourse List Public Serial izers Ġ= Ġmap Of < Int , Ġ( Course List ) Ġ-> ĠJSONArray >( ĊĠĠĠĠ 1 Ġto Ġ:: serialize Public Course List V 1 , ĊĠĠĠĠ 2 Ġto Ġ:: serialize Public Course List V 2 Ċ ) Ċ Ċ fun ĠCourse List . serialize Public ( version : ĠInt Ġ= ĠL ATE ST _ PUBLIC _ API _ VERSION ): ĠJSONArray Ġ{ ĊĠĠĠ Ġval Ġserializer Ġ= ĠCourse List Public Serial izers [ version ] Ġ?: Ġerror (" Cannot Ġget Ġcourse Ġlist Ġpublic Ġserializer Ġfor ĠAPI ĠV $ version ") ĊĠĠĠ Ġreturn Ġserializer ( this ) Ċ } ĊĊ Ċ private Ġval ĠTime Line Serial izers Ġ= Ġmap Of < Int , Ġ( Time Line ) Ġ-> ĠJSONArray >( ĊĠĠĠĠ 4 Ġto Ġ:: serialize Time Line V 4 , ĊĠĠĠĠ 5 Ġto Ġ:: serialize Time Line V 5 , ĊĠĠĠĠ 6 Ġto Ġ:: serialize Time Line V 6 , ĊĠĠĠĠ 7 Ġto Ġ:: serialize Time Line V 6 , ĊĠĠĠĠ 8 Ġto Ġ:: serialize Time Line V 6 , ĊĠĠĠĠ 9 Ġto Ġ:: serialize Time Line V 9 , ĊĠĠĠĠ 1 0 Ġto Ġ:: serialize Time Line V 9 , ĊĠĠĠĠ 1 1 Ġto Ġ:: serialize Time Line V 9 , ĊĠĠĠĠ 1 2 Ġto Ġ:: serialize Time Line V 9 , ĊĠĠĠĠ 1 3 Ġto Ġ:: serialize Time Line V 9 , Ċ ) Ċ Ċ fun ĠTime Line . serialize ( version : ĠInt Ġ= ĠL ATE ST _ API _ VERSION ): ĠJSONObject Ġ{ ĊĠĠĠ Ġval Ġserializer Ġ= ĠTime Line Serial izers [ version ] Ġ?: Ġerror (" Cannot Ġget Ġtime Ġline Ġserializer Ġfor ĠAPI ĠV $ version ") ĊĠĠĠ Ġval Ġjson Ġ= Ġserializer ( this ) ĊĠĠĠ Ġreturn Ġjson . wrap Version ( version ) Ċ } Ċ