title: How to pass data class as Parcelable in a bundle?
body: <p>I have a sealed class like so:    </p>
  
  <pre><code>sealed class SealedClass {
  
      object Object1 : SealedClass()
      object Object2 : SealedClass()
      object Object3 : SealedClass()
  
      data class DataClass(val sealedClass: SealedClass, val anotherDataType: AnotherDataType? = null)
  }
  </code></pre>
  
  <p>I would like to pass my data class in a Bundle like we normally pass values to a new fragment like so:</p>
  
  <pre><code>@JvmStatic
  fun newInstance(dataClass: DataClass): Fragment {
      val fragment = Fragment()
  
      val args = Bundle(1)
      args.putParcelable("DATA_CLASS", dataClass)
      fragment.arguments = args
  
      return fragment
  }
  </code></pre>
  
  <p>I'm not sure how to go about this. So far what I've read is that people use an <code>@Parcelize</code> annotation, which is an experimental feature of Kotlin that I'm trying to avoid. Another approach is to extend the data class by Parcelable and implement the Parcelable methods, but since I use custom classes as parameters in the DataClass (for instance, SealedClass), I don't know how to read/write those values inside Parcelable implementation. Is this not a right approach to go about it?</p>