package Ġnl . te un . k weet er Ċ Ċ import Ġcom . google . gson . Gson Ċ import Ġcom . google . gson . Gson Builder Ċ import Ġcom . google . gson . reflect . Type Token Ċ import Ġnl . te un . k weet er . domain . AuthToken Ċ import Ġnl . te un . k weet er . domain . K weet Ċ import Ġnl . te un . k weet er . domain . Profile Ċ import Ġnl . te un . k weet er . domain . Profile Follower Ċ import Ġnl . te un . k weet er . fac ades . AuthToken Facade Ċ import Ġnl . te un . k weet er . fac ades . Profile Facade Ċ import Ġnl . te un . k weet er . fac ades . Profile Follower Facade Ċ import Ġnl . te un . k weet er . fac ades . rest . K weet Rest Facade Ċ import Ġnl . te un . k weet er . fac ades . rest . Profile Rest Facade Ċ import Ġjava . time . Instant Ċ import Ġjava . time . LocalDateTime Ċ import Ġjava . time . Zone Id Ċ import Ġjava . util .* Ċ import Ġjavax . ws . rs . core . Response Ċ Ċ fun ĠLocalDateTime . to JavaUtil Date (): ĠDate Ġ{ ĊĠĠĠ Ġval Ġinstant Ġ= ĠInstant . from ( this . at Zone ( Zone Id . system Default ())) ĊĠĠĠ Ġreturn Ġjava . util . Date . from ( instant ) Ċ } Ċ Ċ val ĠApi BaseUrl Ġ= Ġ" http :// localhost : 8 0 8 0 / K weet er - Backend / api " Ċ Ċ fun ĠProfile . to Profile Facade () Ġ= ĠProfile Facade ( this ) Ċ fun ĠProfile . to Profile Rest Facade () Ġ= ĠProfile Rest Facade ( this ) Ċ fun ĠProfile . to H ate o as () Ġ= Ġ"$ Api BaseUrl / profiles /${ this . id }" Ċ Ċ fun ĠK weet . to Facade () Ġ= Ġnl . te un . k weet er . fac ades . K weet Facade ( this ) Ċ fun ĠK weet . to Rest Facade () Ġ= ĠK weet Rest Facade ( this ) ĊĊ Ċ fun ĠAuth Token . to Auth Facade () Ġ= ĠAuth Token Facade ( this ) Ċ fun ĠProfile Follower . to Follower Facade () Ġ= ĠProfile Follower Facade ( this ) Ċ Ċ fun ĠhttpResponse NotFound (): ĠResponse . Response Builder Ġ{ ĊĠĠĠ Ġreturn ĠResponse . status ( Response . Status . INTERNAL _ SERVER _ ERROR ) Ċ } Ċ Ċ fun ĠhttpResponse BadRequest (): ĠResponse . Response Builder Ġ{ ĊĠĠĠ Ġreturn ĠResponse . status ( Response . Status . BAD _ REQUEST ) Ċ } Ċ Ċ fun ĠK weet . get Topics () Ġ= Ġ"# [ a - zA - Z 0 - 9 ]+ ". to Regex (). findAll ( this . textContent . sub Sequence ( 0 , ĠInt . MAX _ VALUE )). map Ġ{ Ġit . value Ġ} Ċ Ċ fun ĠAny . toJson () Ġ= ĠGson (). toJson ( this ) Ċ inline Ġfun Ġ< re ified ĠT > ĠAny . toJson ( json Serializer : ĠGson ) Ġ= ĊĠĠĠĠĠĠĠ ĠGson Builder (). register Type Adapter ( T :: class . java , Ġjson Serializer ). create (). toJson ( this ) Ċ Ċ inline Ġfun Ġ< re ified ĠT > ĠGson . fromJson Array ( s : ĠString ): ĠList < T > Ġ{ ĊĠĠĠ Ġval Ġlist Type Ġ= Ġobject Ġ: ĠType Token < List < T >>() Ġ{ ĊĊĠĠĠ Ġ}. type ĊĠĠĠ Ġreturn Ġthis . fromJson ( s , Ġlist Type ) Ċ } ĊĊ