Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.5, 6.0.0-beta1
    • Fix Version/s: 1.5.6, 6.0.0-beta2
    • Component/s: wicket
    • Labels:
      None

      Description

      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.

        Activity

        Hide
        Carl-Eric Menzel added a comment -

        A patch against 1.5.5 that provides these methods (ultimately delegating to Strings.java)

        Show
        Carl-Eric Menzel added a comment - A patch against 1.5.5 that provides these methods (ultimately delegating to Strings.java)
        Hide
        Carl-Eric Menzel added a comment -

        Equivalent patch against master.

        Show
        Carl-Eric Menzel added a comment - Equivalent patch against master.
        Hide
        vineet semwal added a comment - - edited

        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)

        Show
        vineet semwal added a comment - - edited 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)
        Hide
        Martin Grigorov added a comment -

        Patch applied.
        Thanks!

        Show
        Martin Grigorov added a comment - Patch applied. Thanks!

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Carl-Eric Menzel
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development