Since Kotlin 1.1 use isData
property on KClass
. (docs)
Before Kotlin 1.1 you can try to use some heuristics, like check that it contains next methods:
public final copy
public final component{N}
public static copy$default
Note these implementation details could be changed in the future.