You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Carl-Eric Menzel (Created) (JIRA)" <ji...@apache.org> on 2012/04/02 18:53:24 UTC

[jira] [Created] (WICKET-4486) Give StringValue toEnum methods

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: 6.0.0-beta1, 1.5.5
            Reporter: Carl-Eric Menzel
            Priority: Minor


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

        

[jira] [Commented] (WICKET-4486) Give StringValue toEnum methods

Posted by "vineet semwal (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13244454#comment-13244454 ] 

vineet semwal commented on WICKET-4486:
---------------------------------------

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

        

[jira] [Updated] (WICKET-4486) Give StringValue toEnum methods

Posted by "Carl-Eric Menzel (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carl-Eric Menzel updated WICKET-4486:
-------------------------------------

    Attachment: 1.5-WICKET-4486-StringValue-toEnum.patch

A patch against 1.5.5 that provides these methods (ultimately delegating to Strings.java)
                
> 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
>
>
> 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

        

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

Posted by "vineet semwal (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ 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

        

[jira] [Updated] (WICKET-4486) Give StringValue toEnum methods

Posted by "Carl-Eric Menzel (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carl-Eric Menzel updated WICKET-4486:
-------------------------------------

    Attachment: 6.0-WICKET-4486-StringValue-toEnum.patch

Equivalent patch against master.
                
> 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

        

[jira] [Resolved] (WICKET-4486) Give StringValue toEnum methods

Posted by "Martin Grigorov (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-4486.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 6.0.0-RC1
                   1.5.6
         Assignee: Martin Grigorov

Patch applied.
Thanks!
                
> 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
>            Assignee: Martin Grigorov
>            Priority: Minor
>             Fix For: 1.5.6, 6.0.0-RC1
>
>         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