[ 
https://issues.apache.org/jira/browse/WICKET-6396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16055942#comment-16055942
 ] 

Kamil commented on WICKET-6396:
-------------------------------

[~mgrigorov] me too :) But I understand that because of lack of Inheritance 
they fit just for specific needs, hence shouldn't be wicket-wide (that is why I 
have them tailored to me in my project).
Funny thing is Java9 will introduce List.of, Set.of etc, so maybe there is a 
reasoning behind it...


[~svenmeier] So we all agree that
{code}
IModel<Boolean> isPresent()
{code}
and 
{code}
IModel.toOptional()
{code}
are necessary but you don't like:
{code}
public <X extends Throwable> T orElseThrow(Supplier<? extends X> 
exceptionSupplier) throws X;
{code}
and
{code}
public void ifPresent(Consumer<? super T> consumer);
{code}
because they don't return Model nor boolean?

> Model should provide other Optional's methods
> ---------------------------------------------
>
>                 Key: WICKET-6396
>                 URL: https://issues.apache.org/jira/browse/WICKET-6396
>             Project: Wicket
>          Issue Type: Improvement
>    Affects Versions: 8.0.0-M6
>            Reporter: Kamil
>            Priority: Minor
>
> Model should provide
> {code}
> public <X extends Throwable> T orElseThrow(Supplier<? extends X> 
> exceptionSupplier) throws X;
> {code}
> {code}
> public boolean isPresent();
> {code}
> {code}
> public void ifPresent(Consumer<? super T> consumer);
> {code}
> methods for the sake of consistency with Optional API



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to