{"action":"created","issue":{"url":"https://api.github.com/repos/immutables/immutables/issues/438","repository_url":"https://api.github.com/repos/immutables/immutables","labels_url":"https://api.github.com/repos/immutables/immutables/issues/438/labels{/name}","comments_url":"https://api.github.com/repos/immutables/immutables/issues/438/comments","events_url":"https://api.github.com/repos/immutables/immutables/issues/438/events","html_url":"https://github.com/immutables/immutables/issues/438","id":175231307,"number":438,"title":"Generate Builder with static compile-time safe checking of mandatory attributes","user":{"login":"vorburger","id":298598,"avatar_url":"https://avatars.githubusercontent.com/u/298598?v=3","gravatar_id":"","url":"https://api.github.com/users/vorburger","html_url":"https://github.com/vorburger","followers_url":"https://api.github.com/users/vorburger/followers","following_url":"https://api.github.com/users/vorburger/following{/other_user}","gists_url":"https://api.github.com/users/vorburger/gists{/gist_id}","starred_url":"https://api.github.com/users/vorburger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vorburger/subscriptions","organizations_url":"https://api.github.com/users/vorburger/orgs","repos_url":"https://api.github.com/users/vorburger/repos","events_url":"https://api.github.com/users/vorburger/events{/privacy}","received_events_url":"https://api.github.com/users/vorburger/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/immutables/immutables/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-06T12:11:36Z","updated_at":"2016-10-03T05:02:28Z","closed_at":null,"body":"Have you considered generating Builders which allow some nullable attributes yet enforce the presence of all other mandatory (required) attributes at compile time, instead of by [exception at runtime by validation on build()](https://immutables.github.io/immutable.html#builder) ?\r\n\r\nSee e.g. my [Person.java](https://github.com/vorburger/eclipse-null-eea-augments/blob/12a59e0dad053536bb1ac1beb25a23673b24eca2/examples/eclipse/hello/src/main/java/ch/vorburger/nulls/examples/hello/Person.java) for a (hand-written, example) of the pattern I mean.  --  According to @eamonnmcmanus apparently it may even be possible to use Java generics to lift the requirement that properties need to be set in a particular order, with the generics keep track of which properties have been set (I do not know how to do this).\r\n\r\nFTR: I've originally [proposed the same idea to google/auto as well](https://github.com/google/auto/issues/370), but it's less of a fit there because with AutoValue the user still has to write the public facing API as it never generate APIs, only implement APIs that the user has written."},"comment":{"url":"https://api.github.com/repos/immutables/immutables/issues/comments/251027082","html_url":"https://github.com/immutables/immutables/issues/438#issuecomment-251027082","issue_url":"https://api.github.com/repos/immutables/immutables/issues/438","id":251027082,"user":{"login":"androidfred","id":870822,"avatar_url":"https://avatars.githubusercontent.com/u/870822?v=3","gravatar_id":"","url":"https://api.github.com/users/androidfred","html_url":"https://github.com/androidfred","followers_url":"https://api.github.com/users/androidfred/followers","following_url":"https://api.github.com/users/androidfred/following{/other_user}","gists_url":"https://api.github.com/users/androidfred/gists{/gist_id}","starred_url":"https://api.github.com/users/androidfred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/androidfred/subscriptions","organizations_url":"https://api.github.com/users/androidfred/orgs","repos_url":"https://api.github.com/users/androidfred/repos","events_url":"https://api.github.com/users/androidfred/events{/privacy}","received_events_url":"https://api.github.com/users/androidfred/received_events","type":"User","site_admin":false},"created_at":"2016-10-03T05:02:28Z","updated_at":"2016-10-03T05:02:28Z","body":"IMO this would be a better style of implementation (as referenced on https://github.com/immutables/immutables/issues/450)\r\n\r\nhttp://blog.crisp.se/2013/10/09/perlundholm/another-builder-pattern-for-java"}}
{"actor":{"display_login":"androidfred"}}