Simpler method to call overloaded constructors in Kotlin data classes

Solution for Simpler method to call overloaded constructors in Kotlin data classes
is Given Below:

I’m creating a class hierarchy to copy a subset of data from an existing hierarchy. There are about 10 classes with a total of around 100 properties, and is likely to expand.

However a lot of this data has RequiresApi attributes, and it looks like I can’t use if statements to call constructor overloads without creating a lot of if statements.

Here’s a cut down example:

class BigData {

    @RequiresApi(28)
    fun name() :String { return ""}


    @RequiresApi(29)
    fun type() :String { return ""}

    @RequiresApi(30)
    fun description() :String  { return ""}

    //lots of other fields
}

data class SmallData (
    val name :String,
    val type :String,
    val descriptor :String
) {

    constructor(data :BigData)
        : this(data.name(), data.type(), data.description())

}

Is there anyway to simplify this code so I don’t have to use lots of constructor overloads and if statements? Is there any mapper that can take into account RequiresApi?