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/03 02:26:00 UTC
[jira] [Updated] (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 updated GROOVY-10338:
-------------------------------
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)
was:
Looking at Scala/Kotlin data/case classes, it would be good to add additional helper methods to records. I am proposing:
* {{getAt(int i)}} which returns the i'th component
* {{toList()}} which returns the components as a Tuple (which is also a list)
* {{components()}} which returns the components as a typed tuple
> 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
> Time Spent: 10m
> 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)