{"action":"closed","issue":{"url":"https://api.github.com/repos/immutables/immutables/issues/235","labels_url":"https://api.github.com/repos/immutables/immutables/issues/235/labels{/name}","comments_url":"https://api.github.com/repos/immutables/immutables/issues/235/comments","events_url":"https://api.github.com/repos/immutables/immutables/issues/235/events","html_url":"https://github.com/immutables/immutables/issues/235","id":126311000,"number":235,"title":"Support Guava Functions for field access","user":{"login":"rgabbard-bbn","id":7139661,"avatar_url":"https://avatars.githubusercontent.com/u/7139661?v=3","gravatar_id":"","url":"https://api.github.com/users/rgabbard-bbn","html_url":"https://github.com/rgabbard-bbn","followers_url":"https://api.github.com/users/rgabbard-bbn/followers","following_url":"https://api.github.com/users/rgabbard-bbn/following{/other_user}","gists_url":"https://api.github.com/users/rgabbard-bbn/gists{/gist_id}","starred_url":"https://api.github.com/users/rgabbard-bbn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgabbard-bbn/subscriptions","organizations_url":"https://api.github.com/users/rgabbard-bbn/orgs","repos_url":"https://api.github.com/users/rgabbard-bbn/repos","events_url":"https://api.github.com/users/rgabbard-bbn/events{/privacy}","received_events_url":"https://api.github.com/users/rgabbard-bbn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/immutables/immutables/labels/completed","name":"completed","color":"006b75"},{"url":"https://api.github.com/repos/immutables/immutables/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/immutables/immutables/milestones/21","html_url":"https://github.com/immutables/immutables/milestones/2.1.7","labels_url":"https://api.github.com/repos/immutables/immutables/milestones/21/labels","id":1505195,"number":21,"title":"2.1.7","description":null,"creator":{"login":"elucash","id":1692611,"avatar_url":"https://avatars.githubusercontent.com/u/1692611?v=3","gravatar_id":"","url":"https://api.github.com/users/elucash","html_url":"https://github.com/elucash","followers_url":"https://api.github.com/users/elucash/followers","following_url":"https://api.github.com/users/elucash/following{/other_user}","gists_url":"https://api.github.com/users/elucash/gists{/gist_id}","starred_url":"https://api.github.com/users/elucash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elucash/subscriptions","organizations_url":"https://api.github.com/users/elucash/orgs","repos_url":"https://api.github.com/users/elucash/repos","events_url":"https://api.github.com/users/elucash/events{/privacy}","received_events_url":"https://api.github.com/users/elucash/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":1,"state":"open","created_at":"2016-01-13T18:47:46Z","updated_at":"2016-01-15T09:57:42Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2016-01-13T00:28:08Z","updated_at":"2016-01-15T09:57:42Z","closed_at":"2016-01-15T09:57:42Z","body":"It would be handy if there were an option to generate Guava `Function`s for field access on generated immutable objects, like this:\r\n\r\n```java\r\nclass MyClass {\r\n    public String foo();\r\n    public Function<MyClass, String> fooFunction() {\r\n       return FooFunction.INSTANCE;\r\n    }\r\n    private enum FooFunction implements Function<MyClass, String> {\r\n       INSTANCE;\r\n\r\n       @Override\r\n       public String apply(MyClass obj) {\r\n           return checkNotNull(obj).foo();\r\n       }\r\n\r\n       public String toString() {\r\n           return \"MyClass.fooFunction()\";\r\n       }\r\n   }\r\n}\r\n```\r\n\r\nThis would make it much easier to use Guava's functional features without cluttering up code with lots of boilerplate.  Of course, this is all unnecessary in Java 8, but lots of us cannot use it due to customer requirements or other reasons.\r\n\r\nAlso, perhaps `Predicate`s could be provided for boolean fields.\r\n"}}