Re: [LANG] Null-safe 'operator'

2020-07-19 Thread Juraj Jurčo
Sure, thanks for the help. Best, Juraj+ On Sun, 19 Jul 2020, 10:22 Rob Spoor, wrote: > If you want to use a default, I would put that in the orElse method > (unless you want to use a default intermediate result). If it's > something that needs to be calculated, use orElseGet. > > > On 18/07/20

Re: [LANG] Null-safe 'operator'

2020-07-19 Thread Rob Spoor
If you want to use a default, I would put that in the orElse method (unless you want to use a default intermediate result). If it's something that needs to be calculated, use orElseGet. On 18/07/2020 23:05, Juraj Jurčo wrote: Hi Rob, thanks for the proposal. Yes, you're right I can use this.

Re: [LANG] Null-safe 'operator'

2020-07-18 Thread Gary Gregory
On Sat, Jul 18, 2020 at 5:06 PM Juraj Jurčo wrote: > Hi Rob, > thanks for the proposal. Yes, you're right I can use this. I haven't seen > it before nor realize it. > It also evokes the question whether it's self explanatory. Maybe it was > only me who didn't know it, but I haven't seen either of

Re: [LANG] Null-safe 'operator'

2020-07-18 Thread Juraj Jurčo
Hi Rob, thanks for the proposal. Yes, you're right I can use this. I haven't seen it before nor realize it. It also evokes the question whether it's self explanatory. Maybe it was only me who didn't know it, but I haven't seen either of my colleagues use it. I see you can use also defaults as: Opti

Re: [LANG] Null-safe 'operator'

2020-07-18 Thread Rob Spoor
Can't you just use java.util.Optional? That was added way back (ahum) in Java 8. Converting your example: SubSubSubProperty value = Optional.ofNullable(object) .map(ObjectType::getProperty) .map(Property::getSubProperty) .map(SubProperty::getSubSubProperty

[LANG] Null-safe 'operator'

2020-07-18 Thread Juraj Jurčo
Hi guys, I'm new in this list and I would like to contribute to Apache commons. First of all I would like get some feedback if it makes sense to contribute. Java is slow in implementation of null-safe operator however sometimes it's really needed. So far I didn't find any implementation of this in