Wesley Acheson
01/21/2020, 5:44 PMghedeon
01/21/2020, 6:27 PM::class.sealedSubclasses
if that's what are you looking forHanno
01/21/2020, 7:17 PMWesley Acheson
01/21/2020, 11:10 PMreturn when(type) {
CostPerTransaction::class.simpleName -> CostPerTransaction(unit())
CostPerTransactionTiered::class.simpleName -> CostPerTransactionTiered(unit(), upper())
PercentageFee::class.simpleName -> PercentageFee(percent())
PercentageFeeTiered::class.simpleName -> PercentageFeeTiered(percent(), upper())
...
Thats what I mean by string the variable type is a string. The classes "PercentageFee" etc are in a sealed hirachy. Basically I would like if someone adds to the hirachy to know to find this piece of code and add to it. i.e. all possible branches are covered.Sergei Dubrov [JB]
01/22/2020, 9:28 AMWesley Acheson
01/22/2020, 11:55 AM