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

Map or Property Sort

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.7.2, 1.8-beta-1
    • groovy-jdk
    • None
    • All

    Description

      It would be handy to have a sort method on a Map or Property that would sort by the name/key since this is something that is commonly done. A possible implementation for a Property class might look like this:

      Properties.metaClass.sort = {
      new TreeMap(delegate)
      }

      Example usage would be:

      System.properties.sort()

      Attachments

        Issue Links

          Activity

            People

              paulk Paul King
              cjudd Christopher Judd
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: