{"action":"closed","issue":{"url":"https://api.github.com/repos/rharter/auto-value-moshi/issues/6","labels_url":"https://api.github.com/repos/rharter/auto-value-moshi/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/rharter/auto-value-moshi/issues/6/comments","events_url":"https://api.github.com/repos/rharter/auto-value-moshi/issues/6/events","html_url":"https://github.com/rharter/auto-value-moshi/issues/6","id":105859823,"number":6,"title":"Cache delegate JsonAdapter instances in generated JsonAdapter","user":{"login":"JakeWharton","id":66577,"avatar_url":"https://avatars.githubusercontent.com/u/66577?v=3","gravatar_id":"","url":"https://api.github.com/users/JakeWharton","html_url":"https://github.com/JakeWharton","followers_url":"https://api.github.com/users/JakeWharton/followers","following_url":"https://api.github.com/users/JakeWharton/following{/other_user}","gists_url":"https://api.github.com/users/JakeWharton/gists{/gist_id}","starred_url":"https://api.github.com/users/JakeWharton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JakeWharton/subscriptions","organizations_url":"https://api.github.com/users/JakeWharton/orgs","repos_url":"https://api.github.com/users/JakeWharton/repos","events_url":"https://api.github.com/users/JakeWharton/events{/privacy}","received_events_url":"https://api.github.com/users/JakeWharton/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-10T17:38:09Z","updated_at":"2015-09-10T21:26:20Z","closed_at":"2015-09-10T21:26:20Z","body":"Something like:\r\n```java\r\nprivate final JsonAdapter<String> bar;\r\nprivate final JsonAdapter<Map<String, String>> baz;\r\n\r\nFooJsonAdapter(Moshi moshi) {\r\n  bar = moshi.adapter(String.class);\r\n  baz = moshi.adapter(Types.newParameterizedType(Map.class, String.class, String.class));\r\n}\r\n```\r\nThis saves having to look them up for every serialization/deserialization and also saves the creation of the parameterized type instance for lookup when generic types are used.\r\n\r\nIt also moves configuration exceptions to happen when the user looks up an adapter for their type rather than when serialization actually happens."}}