У меня есть класс данных, расширяющий Serializable.
У меня есть переменные Somme, которые устанавливаются с помощью полей данных объектов.
Мой класс данных выглядит так
data class AvailablePollResponseModel(
@field:JsonProperty("end_date")
val endDate: String? = null,
@field:JsonProperty("question_count")
val questionCount: Int? = null,
@field:JsonProperty("kind")
val kind: Int? = null,
@field:JsonProperty("id")
val id: Int? = null,
@field:JsonProperty("title")
val title: String? = null,
@field:JsonProperty("required_questions_count")
val requiredQuestionsCount: Int? = null,
@field:JsonProperty("status")
val status: Int? = null,
@field:JsonProperty("start_date")
val startDate: String? = null
) : BaseRecyclableObject, Serializable {
val resources: Resources = Resources.getSystem()
override val objTitle: String = title ?: resources.getString(R.string.UNKNOWN_STORE_NAME)
override val objSubtitle: String = endDate?.let { resources.getString(R.string.AVAILABLE_UNTIL, DateHandler.formatReadableYearly(it)) }
?: resources.getString(R.string.NO_END_DATE)
}
Когда я запускаю приложение, я получаю следующее сообщение об ошибке
> com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot
> construct instance of`com.workshop.collect.networking.responsemodels.AvailablePollResponseModel`,
> problem: String resource ID #0x7f0d0009 at [Source:
> (String)"[{"id":880,"start_date":"2018-05-14T10:52:02.393194Z","end_date":null,"user":{"first_name":"Joel","last_name":"Brostrom","full_name":"Joel
> Brostrom","pk":3,"id":3},"module_object":[],"collected_polls":[],"available_polls":[{"id":33,"title":"Run
> for
> life","kind":2,"status":0,"start_date":"2018-04-07T22:00:00Z","end_date":"2018-06-11T22:00:00Z","question_count":4,"required_questions_count":4},{"id":34,"title":"Store
> layout
> report","kind":0,"status":0,"start_date":"2018-04-07T22:00:00Z","end_date":"[truncated
> 278 chars]; line: 1, column: 393] (through reference chain:
> java.util.ArrayList[0]->com.workshop.collect.networking.responsemodels.CheckInResponseModel["available_polls"]->java.util.ArrayList[0])
Как я могу локализовать свои строки, если не могу их сериализовать?