{"action":"closed","issue":{"url":"https://api.github.com/repos/immutables/immutables/issues/557","repository_url":"https://api.github.com/repos/immutables/immutables","labels_url":"https://api.github.com/repos/immutables/immutables/issues/557/labels{/name}","comments_url":"https://api.github.com/repos/immutables/immutables/issues/557/comments","events_url":"https://api.github.com/repos/immutables/immutables/issues/557/events","html_url":"https://github.com/immutables/immutables/issues/557","id":208885588,"number":557,"title":"Question: how to handle mutable attributes","user":{"login":"tmtron","id":20422904,"avatar_url":"https://avatars.githubusercontent.com/u/20422904?v=3","gravatar_id":"","url":"https://api.github.com/users/tmtron","html_url":"https://github.com/tmtron","followers_url":"https://api.github.com/users/tmtron/followers","following_url":"https://api.github.com/users/tmtron/following{/other_user}","gists_url":"https://api.github.com/users/tmtron/gists{/gist_id}","starred_url":"https://api.github.com/users/tmtron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmtron/subscriptions","organizations_url":"https://api.github.com/users/tmtron/orgs","repos_url":"https://api.github.com/users/tmtron/repos","events_url":"https://api.github.com/users/tmtron/events{/privacy}","received_events_url":"https://api.github.com/users/tmtron/received_events","type":"User","site_admin":false},"labels":[{"id":46751412,"url":"https://api.github.com/repos/immutables/immutables/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-02-20T13:51:45Z","updated_at":"2017-02-21T15:21:16Z","closed_at":"2017-02-21T15:21:16Z","body":"For example, let's say I must use the Java7 `java.util.Date` type which is mutable (or any other 3rd party class).\r\n\r\nI can use it as an attribute, everything will be generated correctly, but now the generated Immutable* class is not immutable.\r\n\r\nIs there a way to override the getter for such an attribute, so that I can manually return a defensive copy of the mutable object?\r\n\r\n```\r\npublic Date creationDateTime() {\r\n    return new Date(creationDateTime.getTime());\r\n}\r\n```"}}
{"actor":{"display_login":"tmtron"}}