On 18/05/2023 19:05, Michael Strauß wrote:
Hi John,
the `isPresent()` and `isEmtpy()` methods don't feel entirely natural
to me. I think the problem is that Optional has slightly different
semantics compared to ObservableValue. An Optional either has a value,
or it doesn't. The "it doesn't have
Hi John,
the `isPresent()` and `isEmtpy()` methods don't feel entirely natural
to me. I think the problem is that Optional has slightly different
semantics compared to ObservableValue. An Optional either has a value,
or it doesn't. The "it doesn't have a value" state doesn't feel
exactly equivalen
Hi Michael,
As you're only trying to map to true/false, it is a bit ugly to do this
I suppose:
nullableValue.map(x -> true).orElse(false);
I've encountered situations like these before, where you only want to
know about the presence of a value, and don't care what the value is.
If th
I'm trying to map an ObservableValue such that `null` is mapped to
`false` and any other value is mapped to `true`. The following line of
code should do the trick:
ObservableValue mappedValue = nullableValue.map(x -> x != null);
It turns out that this doesn't work, since `map` doesn't pass `null`