jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig <mdue...@apache.org>
Subject Re: hasProperty vs getProperty
Date Wed, 15 Aug 2012 08:03:33 GMT


On 15.8.12 5:31, Julian Reschke wrote:
> On 2012-08-14 15:47, Michael Dürig wrote:
>> ...
>> An even better way to handle this is to return an Option<T>. Guava has
>> something along these lines [1]. Unfortunately Guava's version of Option
>> is not a monad which makes it not as useful as it could be.
>> ...
>
> It looks cool first, but I'm totally unconvinced that replacing null
> checks by "isPresent()" checks really makes things better.

That's the particular problem with the Guava implementation which 
doesn't provide map/flatMap methods. Having these you don't need 
isPresent() but rather lift your operation into the monad.

Michael

>
> Best regards, Julian

Mime
View raw message