package Ġ` in `. vil ik . model Ċ Ċ import Ġcom . google . gson . Gson Builder Ċ import Ġcom . google . gson . type adapters . Runtime Type Adapter Factory Ċ Ċ enum Ġclass ĠAuthentication Strategy Ġ{ ĊĠ ĠSAS L _ PLAIN , ĊĠ ĠNONE Ċ } Ċ Ċ sealed Ġclass ĠMessage From Client ( ĊĠ Ġval Ġtype : ĠType Ċ ) Ġ{ ĊĠ Ġenum Ġclass ĠType Ġ{ ĊĠĠĠ ĠREQUEST _ CONNECT , ĊĠĠĠ ĠREQUEST _ DIS CONNECT , ĊĠĠĠ ĠSUB SCR IBE _ TO _ RECORD S _ OF _ TOPIC , ĊĠĠĠ ĠUNS UB SCR IBE _ FROM _ RECORD S _ OF _ TOPIC , ĊĠĠĠ ĠSUB SCR IBE _ TO _ OFFSET S _ OF _ CON SUM ER _ GROUP , ĊĠĠĠ ĠUNS UB SCR IBE _ FROM _ OFFSET S _ OF _ CON SUM ER _ GROUP , ĊĠĠĠ ĠSUB SCR IBE _ TO _ OFFSET S _ OF _ TOPIC , ĊĠĠĠ ĠUNS UB SCR IBE _ FROM _ OFFSET S _ OF _ TOPIC , ĊĠĠĠ ĠPRO DU CE _ RECORD ĊĠ Ġ} ĊĊĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠ Ġfun Ġparse ( string : ĠString ): ĠMessage From Client Ġ{ ĊĠĠĠĠĠ Ġval Ġruntime Type Adapter Factory Ġ= ĠRuntimeType Adapter Factory ĊĠĠĠĠĠĠĠ Ġ. of ( Message From Client :: class . java , Ġ" type ") ĊĠĠĠĠĠĠĠ Ġ. register Subtype ( Request Connect :: class . java , ĠType . REQUEST _ CONNECT . name ) ĊĠĠĠĠĠĠĠ Ġ. register Subtype ( Request Disconnect :: class . java , ĠType . REQUEST _ DIS CONNECT . name ) ĊĠĠĠĠĠĠĠ Ġ. register Subtype ( ĊĠĠĠĠĠĠĠĠĠ ĠSubscribe To Records Of Topic :: class . java , ĊĠĠĠĠĠĠĠĠĠ ĠType . SUB SCR IBE _ TO _ RECORD S _ OF _ TOPIC . name ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ. register Subtype ( ĊĠĠĠĠĠĠĠĠĠ ĠUn subscribe From Records Of Topic :: class . java , ĊĠĠĠĠĠĠĠĠĠ ĠType . UN SUB SCR IBE _ FROM _ RECORD S _ OF _ TOPIC . name ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ. register Subtype ( ĊĠĠĠĠĠĠĠĠĠ ĠSubscribe To Offsets Of Consumer Group :: class . java , ĊĠĠĠĠĠĠĠĠĠ ĠType . SUB SCR IBE _ TO _ OFFSET S _ OF _ CON SUM ER _ GROUP . name ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ. register Subtype ( ĊĠĠĠĠĠĠĠĠĠ ĠUn subscribe From Offsets Of Consumer Group :: class . java , ĊĠĠĠĠĠĠĠĠĠ ĠType . UN SUB SCR IBE _ FROM _ OFFSET S _ OF _ CON SUM ER _ GROUP . name ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ. register Subtype ( ĊĠĠĠĠĠĠĠĠĠ ĠSubscribe To Offsets Of Topic :: class . java , ĊĠĠĠĠĠĠĠĠĠ ĠType . SUB SCR IBE _ TO _ OFFSET S _ OF _ TOPIC . name ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ. register Subtype ( ĊĠĠĠĠĠĠĠĠĠ ĠUn subscribe From Offsets Of Topic :: class . java , ĊĠĠĠĠĠĠĠĠĠ ĠType . UN SUB SCR IBE _ FROM _ OFFSET S _ OF _ TOPIC . name ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ. register Subtype ( ĊĠĠĠĠĠĠĠĠĠ ĠPro duce Record :: class . java , ĊĠĠĠĠĠĠĠĠĠ ĠType . PRO DU CE _ RECORD . name ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠ Ġreturn ĠGson Builder () ĊĠĠĠĠĠĠĠ Ġ. register Type Adapter Factory ( runtime Type Adapter Factory ) ĊĠĠĠĠĠĠĠ Ġ. create () ĊĠĠĠĠĠĠĠ Ġ. fromJson ( string , ĠMessage From Client :: class . java ) ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ Ċ class ĠRequest Connect ( ĊĠĠĠĠĠĠĠ Ġval Ġenvironment Id : ĠString , ĊĠĠĠĠĠĠĠ Ġval Ġbro kers : ĠList < String >, ĊĠĠĠĠĠĠĠ Ġval Ġauthentication Strategy : ĠAuthentication Strategy , ĊĠĠĠĠĠĠĠ Ġval Ġusername : ĠString ?, ĊĠĠĠĠĠĠĠ Ġval Ġpassword : ĠString ? Ċ ) Ġ: ĠMessage From Client ( Type . REQUEST _ CONNECT ) Ċ Ċ class ĠRequest Disconnect Ġ: ĠMessage From Client ( Type . REQUEST _ DIS CONNECT ) Ċ Ċ class ĠSubscribe To Records Of Topic ( ĊĠ Ġval Ġtopic : ĠString Ċ ) Ġ: ĠMessage From Client ( Type . SUB SCR IBE _ TO _ RECORD S _ OF _ TOPIC ) Ċ Ċ class ĠUn subscribe From Records Of Topic ( ĊĠ Ġval Ġtopic : ĠString Ċ ) Ġ: ĠMessage From Client ( Type . UN SUB SCR IBE _ FROM _ RECORD S _ OF _ TOPIC ) Ċ Ċ class ĠSubscribe To Offsets Of Consumer Group ( ĊĠ Ġval ĠgroupId : ĠString Ċ ) Ġ: ĠMessage From Client ( Type . SUB SCR IBE _ TO _ OFFSET S _ OF _ CON SUM ER _ GROUP ) Ċ Ċ class ĠUn subscribe From Offsets Of Consumer Group ( ĊĠ Ġval ĠgroupId : ĠString Ċ ) Ġ: ĠMessage From Client ( Type . UN SUB SCR IBE _ FROM _ OFFSET S _ OF _ CON SUM ER _ GROUP ) Ċ Ċ class ĠSubscribe To Offsets Of Topic ( ĊĠ Ġval Ġtopic : ĠString Ċ ) Ġ: ĠMessage From Client ( Type . SUB SCR IBE _ TO _ OFFSET S _ OF _ TOPIC ) Ċ Ċ class ĠUn subscribe From Offsets Of Topic ( ĊĠ Ġval Ġtopic : ĠString Ċ ) Ġ: ĠMessage From Client ( Type . UN SUB SCR IBE _ FROM _ OFFSET S _ OF _ TOPIC ) Ċ Ċ class ĠPro duce Record ( ĊĠ Ġval Ġtopic : ĠString , ĊĠ Ġval Ġkey : ĠString , ĊĠ Ġval Ġvalue : ĠString Ċ ) Ġ: ĠMessage From Client ( Type . PRO DU CE _ RECORD )