You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Christopher Smith (JIRA)" <ji...@apache.org> on 2016/02/15 22:16:18 UTC

[jira] [Commented] (GROOVY-7601) shallow parameter for @Immutable

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

Christopher Smith commented on GROOVY-7601:
-------------------------------------------

It's a clumsy workaround, because I have to list every possibly-mutable field type. The request is for a blanket {{*}} option.

> shallow parameter for @Immutable
> --------------------------------
>
>                 Key: GROOVY-7601
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7601
>             Project: Groovy
>          Issue Type: Improvement
>    Affects Versions: 2.4.4
>            Reporter: Christopher Smith
>
> I am using {{@Immutable}} for some command objects, where some of the fields are sometimes-complex domain objects. In this case, I don't need deep immutability for semantic correctness, and it would be helpful to have a parameter to indicate that the transform shouldn't bother checking the fields' types, just make them final and generate the appropriate methods:
> {code}
> @Immutable(shallow = true)
> class PayCommand {
>   Invoice invoice
>   Money amount
> }
> {code}



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