krotki
08/09/2016, 12:27 PMdata class Molor(val molor: String) {
val articleId: Long
val colorId: Long
override fun toString(): String {
return molor.replace("_", "-")
}
init {
validateEx(molor)
val list = molor.split("_", "-")
this.articleId = list[0].toLong()
this.colorId = list[1].toLong()
}
}
that i want to deserialize with jackson (v2.8.1 with kotlin module 2.8.1)
but jackson tells me there is no string constructor ...
com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of com.ps.models.Molor: no String-argument constructor/factory method to deserialize from String value ('00008979_0010')