You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "M. Justin (JIRA)" <ji...@apache.org> on 2016/06/16 20:44:05 UTC

[jira] [Comment Edited] (GROOVY-5711) add a Map.minus(Collection) method to GDK

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

M. Justin edited comment on GROOVY-5711 at 6/16/16 8:43 PM:
------------------------------------------------------------

Even if it's not the "minus" method, a "withoutKeys" (or similar, better named method) would still be useful to me.  In my scripts and Spock tests, often I want a copy of a map but with entries corresponding to certain keys removed. Right now, it's a bit verbose to do that manually, and this feels like the type of method Groovy would have.


was (Author: mjjustin):
Even if it's not the "minus" method, something like "withoutKeys" or something would still be useful to me.  In my scripts and Spock tests, often I want a copy of a map but with certain removed.  Right now, it's a bit verbose to do that manually, and this feels like the type of method Groovy would have.

> add a Map.minus(Collection) method to GDK
> -----------------------------------------
>
>                 Key: GROOVY-5711
>                 URL: https://issues.apache.org/jira/browse/GROOVY-5711
>             Project: Groovy
>          Issue Type: Improvement
>          Components: groovy-jdk
>    Affects Versions: 2.0.2
>            Reporter: Rob Fletcher
>            Assignee: Jochen Theodorou
>            Priority: Minor
>
> Currently we can do Map.minus(Map) but it would probably be useful to be able to filter a Map based on its keys. If we had Map.minus(Collection) where the Collection parameter represents the set of keys that should be removed this kind of filtering would be trivial.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)