Hi all,
Please review this changeset that introduces a new no-arg method orElseThrow()
to Optional, as a preferred alternative to the get() method.
Corresponding methods are also added to OptionalDouble, Int, and Long.
The orElseThrow() method is functionally identical to get(). It has some
On Dec 7, 2017, at 4:33 PM, Stuart Marks wrote:
> Please review this changeset that introduces a new no-arg method
> orElseThrow() to Optional, as a preferred alternative to the get() method.
Looks OK to me.
> Corresponding methods are also added to OptionalDouble, Int, and Long.
>
> The orEl
On 08/12/2017 00:33, Stuart Marks wrote:
Hi all,
Please review this changeset that introduces a new no-arg method
orElseThrow() to Optional, as a preferred alternative to the get()
method.
This looks good. The naming is consistent and I think better than the
"getWhenPresent" proposed in the
- Mail original -
> De: "Alan Bateman"
> À: "Stuart Marks" , "core-libs-dev"
>
> Envoyé: Vendredi 8 Décembre 2017 10:10:15
> Objet: Re: RFR(s): 8140281 add no-arg Optional.orElseThrow() as preferred
> alternative to get()
>
ve the method mapTo*/flatMapTo* and
Optional[Primitive] the method boxed().
regards,
Rémi
- Mail original -
> De: "Stuart Marks"
> À: "core-libs-dev"
> Envoyé: Vendredi 8 Décembre 2017 01:33:41
> Objet: RFR(s): 8140281 add no-arg Optional.orElseThrow() as prefe
Please review this changeset that introduces a new no-arg method
orElseThrow() to Optional, as a preferred alternative to the get()
method.
This looks good. The naming is consistent and I think better than the
"getWhenPresent" proposed in the original thread.
i agree with Alan.
Having a na
the method boxed().
regards,
Rémi
- Mail original -
De: "Stuart Marks"
À: "core-libs-dev"
Envoyé: Vendredi 8 Décembre 2017 01:33:41
Objet: RFR(s): 8140281 add no-arg Optional.orElseThrow() as preferred
alternative to get()
Hi all,
Please review this changese
On 8 December 2017 at 00:33, Stuart Marks wrote:
> Please review this changeset that introduces a new no-arg method
> orElseThrow() to Optional, as a preferred alternative to the get() method.
I am willing to accept this addition as it has an obvious parallel to
the existing supplier method.
My
- Mail original -
> De: "Stuart Marks"
> À: "Remi Forax"
> Cc: "core-libs-dev"
> Envoyé: Samedi 9 Décembre 2017 01:00:06
> Objet: Re: RFR(s): 8140281 add no-arg Optional.orElseThrow() as preferred
> alternative to get()
> Please, l
- Mail original -
> De: "Stuart Marks"
> À: "Remi Forax" , "Alan Bateman"
> Cc: "core-libs-dev"
> Envoyé: Samedi 9 Décembre 2017 00:48:08
> Objet: Re: RFR(s): 8140281 add no-arg Optional.orElseThrow() as preferred
> al
On 12/9/17 1:20 AM, Stephen Colebourne wrote:
On 8 December 2017 at 00:33, Stuart Marks wrote:
Please review this changeset that introduces a new no-arg method
orElseThrow() to Optional, as a preferred alternative to the get() method.
I am willing to accept this addition as it has an obvious
Hello!
I think that both methods could co-exist with slightly different
semantics (even though they implementation is identical):
The get() method should be called when it's evident from the narrow
context that Optional is present at the point and using functional
alternatives (like ifPresent())
On 12/18/17 2:31 AM, Tagir Valeev wrote:
I think that both methods could co-exist with slightly different
semantics (even though they implementation is identical):
...
Think of get() as
an assertion-like method: if get() throws, then it's a bug in the code
(most likely right in this method).
..
13 matches
Mail list logo