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

Map should have an isCase method

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.7.5, 1.8-beta-2
    • 1.7.6, 1.8-beta-3
    • None
    • None

    Description

      Map currently has no specific isCase method.
      Possible definitions:

      public static boolean isCase(Map caseValue, Object switchValue) {
          return DefaultTypeTransformation.castToBoolean(caseValue.get(switchValue));
      }
      

      or this:

      public static boolean isCase(Map caseValue, Object switchValue) {
          return DefaultTypeTransformation.compareEqual(caseValue, switchValue);
      }
      

      Of these, probably the first is better as it fits how isCase is done for regex and lists etc.

      Attachments

        Activity

          People

            paulk Paul King
            paulk Paul King
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: