I have a sealed class like so:
public sealed class DocumentBody {
public data class Information(
val Id: String,
val name: String,
val sort: Int = 2
) : DocumentBody ()
public data class Location(
val name: String,
val address: String? = null,
val sort: Int = 3
) : DocumentBody()
public data class Rating(
val name: String,
val rating: Int,
val sort: Int = 3
) : DocumentBody()
}
for each one of these I want the sort to be defaulted but also not overwritten. Currently this can be overwritten. How can I achieve this within this model?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…