I have an object
class Person {
@JsonProperty("name")
var name: String? = null
@JsonProperty("id")
lateinit var id: String}
There is an only empty constructor and I want to create a person so I wrote:
val person = Person()
person.name = "someName"
person.id = "SomeId"
I'm pretty sure that there is a prettier syntax, something like
val person = Person {name = "someName" , id = "someId"}
but I can't find an example. am I missing something? should I create a secondary constructor to use this syntax or is there another way?