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

Enhance records with additional helper methods

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.0.0-beta-2
    • None
    • None

    Description

      Looking at Scala/Kotlin data/case classes, it would be good to add additional helper methods to records. I am proposing (with suggestions from the mailing list):

      • getAt(int i) which returns the i'th component
      • toList() which returns the components as a List
      • toMap() which returns the components as a Map
      • components() which returns the components as a typed tuple (for records with up to currently 16 components)

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

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