Kotlin Data class
error
data class():Serializable で, コンストラクタ時のval, varで、デフォルトを指定しないと
java.lang.RuntimeException: Could not deserialize object. Class abc_analytics.com.rebook.Model.Book does not define a no-argument constructor. If you are using ProGuard, make sure these constructors are not stripped
となる。
デフォルト指定すればOK.
指定しないと、no-argument constructorを指定してないのか...確かに..
Kotlin ProGuardとは?
"constructors are not stripped"
Value Objectで使う
単一のプロパティを含むオブジェクトの場合でもデータクラスを使うと不変なValue Objectを簡単に書くことができます
翻訳: Kotlinベストプラクティス『Idiomatic Kotlin. Best Practices』 - Qiitaより