You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2021/11/04 00:42:00 UTC

[jira] [Resolved] (GROOVY-10338) Enhance records with additional helper methods

     [ https://issues.apache.org/jira/browse/GROOVY-10338?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King resolved GROOVY-10338.
--------------------------------
    Fix Version/s: 4.0.0-beta-2
       Resolution: Fixed

Proposed PR merged.

> Enhance records with additional helper methods
> ----------------------------------------------
>
>                 Key: GROOVY-10338
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10338
>             Project: Groovy
>          Issue Type: Dependency upgrade
>            Reporter: Paul King
>            Assignee: Paul King
>            Priority: Major
>             Fix For: 4.0.0-beta-2
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> 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)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)