Nikolay Kasyanov
09/06/2021, 9:12 AMvalue class ValueClass(val impl: SomeOtherType) {
init {
this.impl = impl.somePreprocessingReturningAnotherImpl()
}
}
Bhullnatik
09/06/2021, 9:22 AMNikolay Kasyanov
09/06/2021, 10:30 AMValueClass
methods to invoke the hacked factory instead of the actual constructor.Nikolay Kasyanov
09/06/2021, 10:38 AMBhullnatik
09/06/2021, 10:43 AMconstructor
is private it should call the invoke
operator if I’m not mistaken, but anyway I’d go this route for your problem, to have a factory method somewhere and force its useNikolay Kasyanov
09/06/2021, 10:46 AMNikolay Kasyanov
09/06/2021, 10:46 AMPetter Måhlén
09/07/2021, 6:28 AMNikolay Kasyanov
09/07/2021, 7:31 AMBigDecimal.stripTrailingZeros()
.
Thanks for the input and pointers!