Serializing Kotlin data class for persistent storage?

已回答

Hi,

I've implemented a PersistentStateComponent class with various properties. The primitive typed properties store and restore successfully. 

However, if the property is a Kotlin data class it does not get stored. I've tried a few approaches to alternate serialization unsuccessfully. In my XML storage I see:

 <option name="myPropName">
<MyDataClass />
</option>

How can I correctly serialize this?

 

Thanks!

hm

0

Please share your PersistentStateComponent code

 

0

请先登录再写评论。