You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "vineet semwal (Issue Comment Edited) (JIRA)" <ji...@apache.org> on 2012/04/02 21:59:24 UTC

[jira] [Issue Comment Edited] (WICKET-4486) Give StringValue toEnum methods

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

vineet semwal edited comment on WICKET-4486 at 4/2/12 7:58 PM:
---------------------------------------------------------------

hey ,thanks for the quicks patch, looks nice , i think two  improvements can be made 

1)you forgot to improve public final <T> T to(final Class<T> type) ,this method should be able to return enum constant when enum class is provided.

2)  at points you are checking argument is not null else  you are throwing illegalargumentexception ,you can instead use Args.notNull(argument,name) 

                
      was (Author: vineetsemwal):
    hey ,thanks for the quicks patch, looks nice , i think two  improvements can be made 

1)you forget to improve public final <T> T to(final Class<T> type) 

2)  at points you are checking argument is not null else  you are throwing illegalargumentexception ,you can instead use Args.notNull(argument,name) 

                  
> Give StringValue toEnum methods
> -------------------------------
>
>                 Key: WICKET-4486
>                 URL: https://issues.apache.org/jira/browse/WICKET-4486
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.5.5, 6.0.0-beta1
>            Reporter: Carl-Eric Menzel
>            Priority: Minor
>         Attachments: 1.5-WICKET-4486-StringValue-toEnum.patch, 6.0-WICKET-4486-StringValue-toEnum.patch
>
>
> In 1.4, Resources had a ValueMap as parameters, which had among other methods #getAsEnum. In 1.5, PageParameters are used instead, and the StringValues used here have all kinds of toSomething methods, but nothing for enums. I propose adding these for completeness.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira