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:43:00 UTC

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

    [ https://issues.apache.org/jira/browse/GROOVY-10338?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17438381#comment-17438381 ] 

Paul King edited comment on GROOVY-10338 at 11/4/21, 12:42 AM:
---------------------------------------------------------------

Proposed PR merged. It also includes a size() method.


was (Author: paulk):
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)