Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-2470

Add support for coercing strings to enum classes with "as" keyword

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.5.2
    • groovy-jdk
    • None
    • Patch

    Description

      It would be cool if the "as" keyword could be used to coerce strings to enum values. Since this currently throws an exception, adding this functionality should have no impact on existing code.

      Attachments

        1. Enum-asType.diff
          2 kB
          Mike Dillon

        Activity

          People

            paulk Paul King
            md5 Mike Dillon
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: