{"action":"created","comment":{"url":"https://api.github.com/repos/square/moshi/pulls/comments/208063002","pull_request_review_id":143799703,"id":208063002,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwODA2MzAwMg==","diff_hunk":"@@ -0,0 +1,72 @@\n+package com.squareup.moshi.adapters;\n+\n+import com.squareup.moshi.Json;\n+import com.squareup.moshi.JsonAdapter;\n+import com.squareup.moshi.JsonDataException;\n+import com.squareup.moshi.JsonReader;\n+import com.squareup.moshi.JsonWriter;\n+import java.io.IOException;\n+import java.util.Arrays;\n+import javax.annotation.Nullable;\n+\n+/**\n+ * A JsonAdapter for enums that allows having a fallback enum value when a deserialized string does\n+ * not match any enum value.\n+ */\n+public final class ConfigurableEnumJsonAdapter<T extends Enum<T>> extends JsonAdapter<T> {\n+  final Class<T> enumType;\n+  final String[] nameStrings;\n+  final T[] constants;\n+  final JsonReader.Options options;\n+  final @Nullable T fallbackValue;\n+\n+  public static <T extends Enum<T>> ConfigurableEnumJsonAdapter<T> create(Class<T> enumType) {\n+    return new ConfigurableEnumJsonAdapter<>(enumType, null);\n+  }\n+\n+  public ConfigurableEnumJsonAdapter<T> withFallbackValue(T fallbackValue) {","path":"adapters/src/main/java/com/squareup/moshi/adapters/ConfigurableEnumJsonAdapter.java","position":null,"original_position":27,"commit_id":"c1264e8fa52068f0ddd6b017dc0d8c32166e2104","original_commit_id":"14858ed7c67c264db02bf40b8c5fe34aa45ea5b7","user":{"login":"NightlyNexus","id":4032667,"node_id":"MDQ6VXNlcjQwMzI2Njc=","avatar_url":"https://avatars2.githubusercontent.com/u/4032667?v=4","gravatar_id":"","url":"https://api.github.com/users/NightlyNexus","html_url":"https://github.com/NightlyNexus","followers_url":"https://api.github.com/users/NightlyNexus/followers","following_url":"https://api.github.com/users/NightlyNexus/following{/other_user}","gists_url":"https://api.github.com/users/NightlyNexus/gists{/gist_id}","starred_url":"https://api.github.com/users/NightlyNexus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NightlyNexus/subscriptions","organizations_url":"https://api.github.com/users/NightlyNexus/orgs","repos_url":"https://api.github.com/users/NightlyNexus/repos","events_url":"https://api.github.com/users/NightlyNexus/events{/privacy}","received_events_url":"https://api.github.com/users/NightlyNexus/received_events","type":"User","site_admin":false},"body":"sounds good.","created_at":"2018-08-07T00:02:25Z","updated_at":"2018-08-07T00:02:25Z","html_url":"https://github.com/square/moshi/pull/607#discussion_r208063002","pull_request_url":"https://api.github.com/repos/square/moshi/pulls/607","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/square/moshi/pulls/comments/208063002"},"html":{"href":"https://github.com/square/moshi/pull/607#discussion_r208063002"},"pull_request":{"href":"https://api.github.com/repos/square/moshi/pulls/607"}},"in_reply_to_id":207762247},"pull_request":{"url":"https://api.github.com/repos/square/moshi/pulls/607","id":204300729,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0MzAwNzI5","html_url":"https://github.com/square/moshi/pull/607","diff_url":"https://github.com/square/moshi/pull/607.diff","patch_url":"https://github.com/square/moshi/pull/607.patch","issue_url":"https://api.github.com/repos/square/moshi/issues/607","number":607,"state":"open","locked":false,"title":"Add ConfigurableEnumJsonAdapter to adapters module.","user":{"login":"NightlyNexus","id":4032667,"node_id":"MDQ6VXNlcjQwMzI2Njc=","avatar_url":"https://avatars2.githubusercontent.com/u/4032667?v=4","gravatar_id":"","url":"https://api.github.com/users/NightlyNexus","html_url":"https://github.com/NightlyNexus","followers_url":"https://api.github.com/users/NightlyNexus/followers","following_url":"https://api.github.com/users/NightlyNexus/following{/other_user}","gists_url":"https://api.github.com/users/NightlyNexus/gists{/gist_id}","starred_url":"https://api.github.com/users/NightlyNexus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NightlyNexus/subscriptions","organizations_url":"https://api.github.com/users/NightlyNexus/orgs","repos_url":"https://api.github.com/users/NightlyNexus/repos","events_url":"https://api.github.com/users/NightlyNexus/events{/privacy}","received_events_url":"https://api.github.com/users/NightlyNexus/received_events","type":"User","site_admin":false},"body":"for consideration. dunno what to call this type.","created_at":"2018-07-27T00:26:19Z","updated_at":"2018-08-07T00:02:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6ca57a294bdfff91aa1432df8216b06739c9defe","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/square/moshi/pulls/607/commits","review_comments_url":"https://api.github.com/repos/square/moshi/pulls/607/comments","review_comment_url":"https://api.github.com/repos/square/moshi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/square/moshi/issues/607/comments","statuses_url":"https://api.github.com/repos/square/moshi/statuses/c1264e8fa52068f0ddd6b017dc0d8c32166e2104","head":{"label":"square:eric.enum","ref":"eric.enum","sha":"c1264e8fa52068f0ddd6b017dc0d8c32166e2104","user":{"login":"square","id":82592,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgyNTky","avatar_url":"https://avatars0.githubusercontent.com/u/82592?v=4","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"repo":{"id":22789601,"node_id":"MDEwOlJlcG9zaXRvcnkyMjc4OTYwMQ==","name":"moshi","full_name":"square/moshi","owner":{"login":"square","id":82592,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgyNTky","avatar_url":"https://avatars0.githubusercontent.com/u/82592?v=4","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/square/moshi","description":"A modern JSON library for Android and Java.","fork":false,"url":"https://api.github.com/repos/square/moshi","forks_url":"https://api.github.com/repos/square/moshi/forks","keys_url":"https://api.github.com/repos/square/moshi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/square/moshi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/square/moshi/teams","hooks_url":"https://api.github.com/repos/square/moshi/hooks","issue_events_url":"https://api.github.com/repos/square/moshi/issues/events{/number}","events_url":"https://api.github.com/repos/square/moshi/events","assignees_url":"https://api.github.com/repos/square/moshi/assignees{/user}","branches_url":"https://api.github.com/repos/square/moshi/branches{/branch}","tags_url":"https://api.github.com/repos/square/moshi/tags","blobs_url":"https://api.github.com/repos/square/moshi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/square/moshi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/square/moshi/git/refs{/sha}","trees_url":"https://api.github.com/repos/square/moshi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/square/moshi/statuses/{sha}","languages_url":"https://api.github.com/repos/square/moshi/languages","stargazers_url":"https://api.github.com/repos/square/moshi/stargazers","contributors_url":"https://api.github.com/repos/square/moshi/contributors","subscribers_url":"https://api.github.com/repos/square/moshi/subscribers","subscription_url":"https://api.github.com/repos/square/moshi/subscription","commits_url":"https://api.github.com/repos/square/moshi/commits{/sha}","git_commits_url":"https://api.github.com/repos/square/moshi/git/commits{/sha}","comments_url":"https://api.github.com/repos/square/moshi/comments{/number}","issue_comment_url":"https://api.github.com/repos/square/moshi/issues/comments{/number}","contents_url":"https://api.github.com/repos/square/moshi/contents/{+path}","compare_url":"https://api.github.com/repos/square/moshi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/square/moshi/merges","archive_url":"https://api.github.com/repos/square/moshi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/square/moshi/downloads","issues_url":"https://api.github.com/repos/square/moshi/issues{/number}","pulls_url":"https://api.github.com/repos/square/moshi/pulls{/number}","milestones_url":"https://api.github.com/repos/square/moshi/milestones{/number}","notifications_url":"https://api.github.com/repos/square/moshi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/square/moshi/labels{/name}","releases_url":"https://api.github.com/repos/square/moshi/releases{/id}","deployments_url":"https://api.github.com/repos/square/moshi/deployments","created_at":"2014-08-09T15:58:42Z","updated_at":"2018-08-06T21:54:13Z","pushed_at":"2018-08-07T00:02:03Z","git_url":"git://github.com/square/moshi.git","ssh_url":"git@github.com:square/moshi.git","clone_url":"https://github.com/square/moshi.git","svn_url":"https://github.com/square/moshi","homepage":"http://square.github.io/moshi/1.x/moshi/","size":1369,"stargazers_count":4068,"watchers_count":4068,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":295,"mirror_url":null,"archived":false,"open_issues_count":43,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":295,"open_issues":43,"watchers":4068,"default_branch":"master"}},"base":{"label":"square:master","ref":"master","sha":"34f8f9472ff3ca09402f16460aada63e4ca0939d","user":{"login":"square","id":82592,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgyNTky","avatar_url":"https://avatars0.githubusercontent.com/u/82592?v=4","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"repo":{"id":22789601,"node_id":"MDEwOlJlcG9zaXRvcnkyMjc4OTYwMQ==","name":"moshi","full_name":"square/moshi","owner":{"login":"square","id":82592,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgyNTky","avatar_url":"https://avatars0.githubusercontent.com/u/82592?v=4","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/square/moshi","description":"A modern JSON library for Android and Java.","fork":false,"url":"https://api.github.com/repos/square/moshi","forks_url":"https://api.github.com/repos/square/moshi/forks","keys_url":"https://api.github.com/repos/square/moshi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/square/moshi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/square/moshi/teams","hooks_url":"https://api.github.com/repos/square/moshi/hooks","issue_events_url":"https://api.github.com/repos/square/moshi/issues/events{/number}","events_url":"https://api.github.com/repos/square/moshi/events","assignees_url":"https://api.github.com/repos/square/moshi/assignees{/user}","branches_url":"https://api.github.com/repos/square/moshi/branches{/branch}","tags_url":"https://api.github.com/repos/square/moshi/tags","blobs_url":"https://api.github.com/repos/square/moshi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/square/moshi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/square/moshi/git/refs{/sha}","trees_url":"https://api.github.com/repos/square/moshi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/square/moshi/statuses/{sha}","languages_url":"https://api.github.com/repos/square/moshi/languages","stargazers_url":"https://api.github.com/repos/square/moshi/stargazers","contributors_url":"https://api.github.com/repos/square/moshi/contributors","subscribers_url":"https://api.github.com/repos/square/moshi/subscribers","subscription_url":"https://api.github.com/repos/square/moshi/subscription","commits_url":"https://api.github.com/repos/square/moshi/commits{/sha}","git_commits_url":"https://api.github.com/repos/square/moshi/git/commits{/sha}","comments_url":"https://api.github.com/repos/square/moshi/comments{/number}","issue_comment_url":"https://api.github.com/repos/square/moshi/issues/comments{/number}","contents_url":"https://api.github.com/repos/square/moshi/contents/{+path}","compare_url":"https://api.github.com/repos/square/moshi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/square/moshi/merges","archive_url":"https://api.github.com/repos/square/moshi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/square/moshi/downloads","issues_url":"https://api.github.com/repos/square/moshi/issues{/number}","pulls_url":"https://api.github.com/repos/square/moshi/pulls{/number}","milestones_url":"https://api.github.com/repos/square/moshi/milestones{/number}","notifications_url":"https://api.github.com/repos/square/moshi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/square/moshi/labels{/name}","releases_url":"https://api.github.com/repos/square/moshi/releases{/id}","deployments_url":"https://api.github.com/repos/square/moshi/deployments","created_at":"2014-08-09T15:58:42Z","updated_at":"2018-08-06T21:54:13Z","pushed_at":"2018-08-07T00:02:03Z","git_url":"git://github.com/square/moshi.git","ssh_url":"git@github.com:square/moshi.git","clone_url":"https://github.com/square/moshi.git","svn_url":"https://github.com/square/moshi","homepage":"http://square.github.io/moshi/1.x/moshi/","size":1369,"stargazers_count":4068,"watchers_count":4068,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":295,"mirror_url":null,"archived":false,"open_issues_count":43,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":295,"open_issues":43,"watchers":4068,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/square/moshi/pulls/607"},"html":{"href":"https://github.com/square/moshi/pull/607"},"issue":{"href":"https://api.github.com/repos/square/moshi/issues/607"},"comments":{"href":"https://api.github.com/repos/square/moshi/issues/607/comments"},"review_comments":{"href":"https://api.github.com/repos/square/moshi/pulls/607/comments"},"review_comment":{"href":"https://api.github.com/repos/square/moshi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/square/moshi/pulls/607/commits"},"statuses":{"href":"https://api.github.com/repos/square/moshi/statuses/c1264e8fa52068f0ddd6b017dc0d8c32166e2104"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"NightlyNexus"}}