carlw
02/07/2017, 7:25 PMpermalmberg
02/07/2017, 7:26 PMcarlw
02/07/2017, 7:27 PMpermalmberg
02/07/2017, 7:28 PMpermalmberg
02/07/2017, 7:28 PMcarlw
02/07/2017, 7:29 PMpermalmberg
02/07/2017, 7:29 PMpermalmberg
02/07/2017, 7:29 PMedvin
02/07/2017, 7:29 PMpermalmberg
02/07/2017, 7:29 PMcarlw
02/07/2017, 7:31 PMpermalmberg
02/07/2017, 7:32 PMpermalmberg
02/07/2017, 7:33 PMcarlw
02/07/2017, 7:33 PMpermalmberg
02/07/2017, 7:34 PMedvin
02/07/2017, 7:35 PMObjectBinding<BigDecimal?>
instead of ObjectBinding<BigDecimal>
. Do you know why we made the return type nullable here?edvin
02/07/2017, 7:39 PMRuckus
02/07/2017, 7:40 PMT!
), so we have to force one way or the other, and this seemed like the safest bet.edvin
02/07/2017, 7:41 PMedvin
02/07/2017, 7:41 PMxBinding
functions returns bindings, not properties. If you think about it, how would a calculated property behave if it was writable? Should it write back into the underlying properties perhaps? TornadoFX actually supports these kinds of proxy properties as well, but I suspect that's not what you're after.
Are you wondering why you get ObjectBinding<BigDecimal?>
instead of ObjectBinding<BigDecimal>
?
The reason is that the underlying property might be null, and if so we might want to return null from the calculated binding as well.
This normally doesn't create an issue, the property is still observable and would carry the correct calculated BigDecimal
value.edvin
02/07/2017, 7:41 PMcarlw
02/07/2017, 7:42 PMcarlw
02/07/2017, 7:42 PMedvin
02/07/2017, 7:43 PMRuckus
02/07/2017, 7:43 PMcarlw
02/07/2017, 7:43 PMcarlw
02/07/2017, 7:44 PMRuckus
02/07/2017, 7:46 PMfun ObservableVaule<BigDecimal?>.isGreaterThan(...): ObjectBinding<BigDecimal?>
(and other such functions)carlw
02/07/2017, 7:48 PMRuckus
02/07/2017, 7:49 PM