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

Support as SortedSet

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0
    • 1.1-beta-1
    • syntax
    • None
    • Patch

    Description

      Right now we can do this sort of thing to create a Set...

      def mySet = [1, 2, 2, 4] as Set
      

      It would be nice to support SortedSet in the same way...

      def mySortedSet = [1, 2, 2, 4] as SortedSet
      

      I have attached a patch that I think gets this done. I am not sure if there are already tests somewhere that cover the as operator. My test method is in CastTest.groovy but of course could be dropped just about anywhere.

      Attachments

        1. asSortedSet.patch
          1 kB
          Jeff Brown

        Activity

          People

            blackdrag Jochen Theodorou
            brownj Jeff Brown
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0.5h
                0.5h
                Remaining:
                Remaining Estimate - 0.5h
                0.5h
                Logged:
                Time Spent - Not Specified
                Not Specified