Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kotlin Inline Class

Kotlin Inline Class

Takuji Nishibayashi

April 12, 2019
Tweet

More Decks by Takuji Nishibayashi

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ • @takuji31 id:takuji31 • Takuji Nishibayashi • Hatena Co.,

    Ltd. • App Team • ίϛοΫDAYS • δϟϯϓϧʔΩʔʂ • ΧΫϤϜ
  2. ࣗݾ঺հ • Android • Kotlin • Flu-er • ! h-ps:/

    /blog.takuji31.jp • " h-ps:/ /nazuna.takuji31.jp • # $ h-ps:/ /photo.takuji31.jp
  3. ID

  4. No Inline classes data class User( val id: String, val

    name: String, val iconUrlTemplate: String, val lastLoggedInAt: String, val birthday: String )
  5. With Inline classes data class User( val id: UserId, val

    name: String, val iconUrlTemplate: UrlTemplate, val lastLoggedInAt: DateTimeString, val birthday: DateString )
  6. private val args: UserFragmentArgs by navArgs() override fun oncreate(savedInstanceState: Bundle?)

    { super.onCreate(savedInstanceState) val userId = args.id // do something }