Kotlin constructor overloading
Im trying to overload a constructor of a class, so that it accepts Strings as well as Ints.
class Load (val duration: Int = 0,val minrep: Int = 0,val maxrep: Int = 0): Serializable{
constructor(duration: String = "0",minrep: String = "0",maxrep: String = "0")
: this(duration.toInt(),minrep.toInt(),maxrep.toInt())
The Problem is since I am forced to call the superconstructor immediatly, I cannot check for "" in the variables which is a possible state which then crashes the app in to...