{"action":"created","comment":{"url":"https://api.github.com/repos/ryotan/code-enum-support/pulls/comments/68224472","id":68224472,"diff_hunk":"@@ -0,0 +1,87 @@\n+/*\n+ * These codes are licensed under CC0.\n+ *\n+ * http://creativecommons.org/publicdomain/zero/1.0/deed\n+ * http://creativecommons.org/publicdomain/zero/1.0/deed.ja\n+ */\n+\n+package io.github.ryotan.code;\n+\n+import java.util.Comparator;\n+import java.util.List;\n+import java.util.function.Predicate;\n+import java.util.stream.Collectors;\n+import java.util.stream.Stream;\n+\n+import io.github.ryotan.code.CodeEnum.Filters;\n+import io.github.ryotan.code.CodeEnum.OptionalLabel;\n+import io.github.ryotan.code.CodeEnum.ShortLabel;\n+import io.github.ryotan.code.util.CodeEnumReflectionUtil;\n+\n+public final class Code {\n+\n+    private static final Comparator<CodeEnum<?>> ORDINAL_COMPARATOR = (c1, c2) -> c1.ordinal() - c2.ordinal();\n+\n+    private Code() {\n+    }\n+\n+    private static boolean matches(CodeEnum<?> candidate, String value) {\n+        return candidate.value().equals(value);\n+    }\n+\n+    private static <C extends CodeEnum<C>> Stream<C> enums(Class<C> code) {\n+        if (code.isEnum()) {\n+            return Stream.of(code.getEnumConstants());\n+        }\n+        throw new IllegalArgumentException(String.format(\"CodeEnum must be enum. class=[%s].\", code.getName()));\n+    }\n+\n+    public static <C extends CodeEnum<C>> C of(Class<C> code, String value) {\n+        return of(code, value, Filters.ANY);\n+    }\n+\n+    public static <C extends CodeEnum<C>> C of(Class<C> code, String value, Predicate<? super C> filter) {","path":"src/main/java/io/github/ryotan/code/Code.java","position":43,"original_position":43,"commit_id":"242cda8f348ca228851fa5e07edb3b4edc515611","original_commit_id":"242cda8f348ca228851fa5e07edb3b4edc515611","user":{"login":"ryotan","id":17810,"avatar_url":"https://avatars.githubusercontent.com/u/17810?v=3","gravatar_id":"","url":"https://api.github.com/users/ryotan","html_url":"https://github.com/ryotan","followers_url":"https://api.github.com/users/ryotan/followers","following_url":"https://api.github.com/users/ryotan/following{/other_user}","gists_url":"https://api.github.com/users/ryotan/gists{/gist_id}","starred_url":"https://api.github.com/users/ryotan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryotan/subscriptions","organizations_url":"https://api.github.com/users/ryotan/orgs","repos_url":"https://api.github.com/users/ryotan/repos","events_url":"https://api.github.com/users/ryotan/events{/privacy}","received_events_url":"https://api.github.com/users/ryotan/received_events","type":"User","site_admin":false},"body":"![Codacy](https://www.codacy.com/assets/images/favicon.png) Issue found: [Missing a Javadoc comment.](https://www.codacy.com/app/ryotan/code-enum-support/file/2825300335/issues/source?bid=3375378&fileBranchId=3375797#l43)","created_at":"2016-06-23T12:23:51Z","updated_at":"2016-06-23T12:23:51Z","html_url":"https://github.com/ryotan/code-enum-support/pull/1#discussion_r68224472","pull_request_url":"https://api.github.com/repos/ryotan/code-enum-support/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/ryotan/code-enum-support/pulls/comments/68224472"},"html":{"href":"https://github.com/ryotan/code-enum-support/pull/1#discussion_r68224472"},"pull_request":{"href":"https://api.github.com/repos/ryotan/code-enum-support/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/ryotan/code-enum-support/pulls/1","id":74822954,"html_url":"https://github.com/ryotan/code-enum-support/pull/1","diff_url":"https://github.com/ryotan/code-enum-support/pull/1.diff","patch_url":"https://github.com/ryotan/code-enum-support/pull/1.patch","issue_url":"https://api.github.com/repos/ryotan/code-enum-support/issues/1","number":1,"state":"open","locked":false,"title":"Add basic functionality.","user":{"login":"ryotan","id":17810,"avatar_url":"https://avatars.githubusercontent.com/u/17810?v=3","gravatar_id":"","url":"https://api.github.com/users/ryotan","html_url":"https://github.com/ryotan","followers_url":"https://api.github.com/users/ryotan/followers","following_url":"https://api.github.com/users/ryotan/following{/other_user}","gists_url":"https://api.github.com/users/ryotan/gists{/gist_id}","starred_url":"https://api.github.com/users/ryotan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryotan/subscriptions","organizations_url":"https://api.github.com/users/ryotan/orgs","repos_url":"https://api.github.com/users/ryotan/repos","events_url":"https://api.github.com/users/ryotan/events{/privacy}","received_events_url":"https://api.github.com/users/ryotan/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-22T17:17:28Z","updated_at":"2016-06-23T12:23:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2917daf77b2e0b5a5062012ce3bedd253b06df6d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ryotan/code-enum-support/pulls/1/commits","review_comments_url":"https://api.github.com/repos/ryotan/code-enum-support/pulls/1/comments","review_comment_url":"https://api.github.com/repos/ryotan/code-enum-support/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ryotan/code-enum-support/issues/1/comments","statuses_url":"https://api.github.com/repos/ryotan/code-enum-support/statuses/242cda8f348ca228851fa5e07edb3b4edc515611","head":{"label":"ryotan:feature/basic-functionality","ref":"feature/basic-functionality","sha":"242cda8f348ca228851fa5e07edb3b4edc515611","user":{"login":"ryotan","id":17810,"avatar_url":"https://avatars.githubusercontent.com/u/17810?v=3","gravatar_id":"","url":"https://api.github.com/users/ryotan","html_url":"https://github.com/ryotan","followers_url":"https://api.github.com/users/ryotan/followers","following_url":"https://api.github.com/users/ryotan/following{/other_user}","gists_url":"https://api.github.com/users/ryotan/gists{/gist_id}","starred_url":"https://api.github.com/users/ryotan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryotan/subscriptions","organizations_url":"https://api.github.com/users/ryotan/orgs","repos_url":"https://api.github.com/users/ryotan/repos","events_url":"https://api.github.com/users/ryotan/events{/privacy}","received_events_url":"https://api.github.com/users/ryotan/received_events","type":"User","site_admin":false},"repo":{"id":61708131,"name":"code-enum-support","full_name":"ryotan/code-enum-support","owner":{"login":"ryotan","id":17810,"avatar_url":"https://avatars.githubusercontent.com/u/17810?v=3","gravatar_id":"","url":"https://api.github.com/users/ryotan","html_url":"https://github.com/ryotan","followers_url":"https://api.github.com/users/ryotan/followers","following_url":"https://api.github.com/users/ryotan/following{/other_user}","gists_url":"https://api.github.com/users/ryotan/gists{/gist_id}","starred_url":"https://api.github.com/users/ryotan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryotan/subscriptions","organizations_url":"https://api.github.com/users/ryotan/orgs","repos_url":"https://api.github.com/users/ryotan/repos","events_url":"https://api.github.com/users/ryotan/events{/privacy}","received_events_url":"https://api.github.com/users/ryotan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ryotan/code-enum-support","description":null,"fork":false,"url":"https://api.github.com/repos/ryotan/code-enum-support","forks_url":"https://api.github.com/repos/ryotan/code-enum-support/forks","keys_url":"https://api.github.com/repos/ryotan/code-enum-support/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ryotan/code-enum-support/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ryotan/code-enum-support/teams","hooks_url":"https://api.github.com/repos/ryotan/code-enum-support/hooks","issue_events_url":"https://api.github.com/repos/ryotan/code-enum-support/issues/events{/number}","events_url":"https://api.github.com/repos/ryotan/code-enum-support/events","assignees_url":"https://api.github.com/repos/ryotan/code-enum-support/assignees{/user}","branches_url":"https://api.github.com/repos/ryotan/code-enum-support/branches{/branch}","tags_url":"https://api.github.com/repos/ryotan/code-enum-support/tags","blobs_url":"https://api.github.com/repos/ryotan/code-enum-support/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ryotan/code-enum-support/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ryotan/code-enum-support/git/refs{/sha}","trees_url":"https://api.github.com/repos/ryotan/code-enum-support/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ryotan/code-enum-support/statuses/{sha}","languages_url":"https://api.github.com/repos/ryotan/code-enum-support/languages","stargazers_url":"https://api.github.com/repos/ryotan/code-enum-support/stargazers","contributors_url":"https://api.github.com/repos/ryotan/code-enum-support/contributors","subscribers_url":"https://api.github.com/repos/ryotan/code-enum-support/subscribers","subscription_url":"https://api.github.com/repos/ryotan/code-enum-support/subscription","commits_url":"https://api.github.com/repos/ryotan/code-enum-support/commits{/sha}","git_commits_url":"https://api.github.com/repos/ryotan/code-enum-support/git/commits{/sha}","comments_url":"https://api.github.com/repos/ryotan/code-enum-support/comments{/number}","issue_comment_url":"https://api.github.com/repos/ryotan/code-enum-support/issues/comments{/number}","contents_url":"https://api.github.com/repos/ryotan/code-enum-support/contents/{+path}","compare_url":"https://api.github.com/repos/ryotan/code-enum-support/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ryotan/code-enum-support/merges","archive_url":"https://api.github.com/repos/ryotan/code-enum-support/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ryotan/code-enum-support/downloads","issues_url":"https://api.github.com/repos/ryotan/code-enum-support/issues{/number}","pulls_url":"https://api.github.com/repos/ryotan/code-enum-support/pulls{/number}","milestones_url":"https://api.github.com/repos/ryotan/code-enum-support/milestones{/number}","notifications_url":"https://api.github.com/repos/ryotan/code-enum-support/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ryotan/code-enum-support/labels{/name}","releases_url":"https://api.github.com/repos/ryotan/code-enum-support/releases{/id}","deployments_url":"https://api.github.com/repos/ryotan/code-enum-support/deployments","created_at":"2016-06-22T09:51:48Z","updated_at":"2016-06-22T14:22:02Z","pushed_at":"2016-06-23T12:21:56Z","git_url":"git://github.com/ryotan/code-enum-support.git","ssh_url":"git@github.com:ryotan/code-enum-support.git","clone_url":"https://github.com/ryotan/code-enum-support.git","svn_url":"https://github.com/ryotan/code-enum-support","homepage":null,"size":33,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"ryotan:develop","ref":"develop","sha":"e23c5831af8d21f5a8528206b7044e867f359f66","user":{"login":"ryotan","id":17810,"avatar_url":"https://avatars.githubusercontent.com/u/17810?v=3","gravatar_id":"","url":"https://api.github.com/users/ryotan","html_url":"https://github.com/ryotan","followers_url":"https://api.github.com/users/ryotan/followers","following_url":"https://api.github.com/users/ryotan/following{/other_user}","gists_url":"https://api.github.com/users/ryotan/gists{/gist_id}","starred_url":"https://api.github.com/users/ryotan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryotan/subscriptions","organizations_url":"https://api.github.com/users/ryotan/orgs","repos_url":"https://api.github.com/users/ryotan/repos","events_url":"https://api.github.com/users/ryotan/events{/privacy}","received_events_url":"https://api.github.com/users/ryotan/received_events","type":"User","site_admin":false},"repo":{"id":61708131,"name":"code-enum-support","full_name":"ryotan/code-enum-support","owner":{"login":"ryotan","id":17810,"avatar_url":"https://avatars.githubusercontent.com/u/17810?v=3","gravatar_id":"","url":"https://api.github.com/users/ryotan","html_url":"https://github.com/ryotan","followers_url":"https://api.github.com/users/ryotan/followers","following_url":"https://api.github.com/users/ryotan/following{/other_user}","gists_url":"https://api.github.com/users/ryotan/gists{/gist_id}","starred_url":"https://api.github.com/users/ryotan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryotan/subscriptions","organizations_url":"https://api.github.com/users/ryotan/orgs","repos_url":"https://api.github.com/users/ryotan/repos","events_url":"https://api.github.com/users/ryotan/events{/privacy}","received_events_url":"https://api.github.com/users/ryotan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ryotan/code-enum-support","description":null,"fork":false,"url":"https://api.github.com/repos/ryotan/code-enum-support","forks_url":"https://api.github.com/repos/ryotan/code-enum-support/forks","keys_url":"https://api.github.com/repos/ryotan/code-enum-support/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ryotan/code-enum-support/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ryotan/code-enum-support/teams","hooks_url":"https://api.github.com/repos/ryotan/code-enum-support/hooks","issue_events_url":"https://api.github.com/repos/ryotan/code-enum-support/issues/events{/number}","events_url":"https://api.github.com/repos/ryotan/code-enum-support/events","assignees_url":"https://api.github.com/repos/ryotan/code-enum-support/assignees{/user}","branches_url":"https://api.github.com/repos/ryotan/code-enum-support/branches{/branch}","tags_url":"https://api.github.com/repos/ryotan/code-enum-support/tags","blobs_url":"https://api.github.com/repos/ryotan/code-enum-support/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ryotan/code-enum-support/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ryotan/code-enum-support/git/refs{/sha}","trees_url":"https://api.github.com/repos/ryotan/code-enum-support/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ryotan/code-enum-support/statuses/{sha}","languages_url":"https://api.github.com/repos/ryotan/code-enum-support/languages","stargazers_url":"https://api.github.com/repos/ryotan/code-enum-support/stargazers","contributors_url":"https://api.github.com/repos/ryotan/code-enum-support/contributors","subscribers_url":"https://api.github.com/repos/ryotan/code-enum-support/subscribers","subscription_url":"https://api.github.com/repos/ryotan/code-enum-support/subscription","commits_url":"https://api.github.com/repos/ryotan/code-enum-support/commits{/sha}","git_commits_url":"https://api.github.com/repos/ryotan/code-enum-support/git/commits{/sha}","comments_url":"https://api.github.com/repos/ryotan/code-enum-support/comments{/number}","issue_comment_url":"https://api.github.com/repos/ryotan/code-enum-support/issues/comments{/number}","contents_url":"https://api.github.com/repos/ryotan/code-enum-support/contents/{+path}","compare_url":"https://api.github.com/repos/ryotan/code-enum-support/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ryotan/code-enum-support/merges","archive_url":"https://api.github.com/repos/ryotan/code-enum-support/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ryotan/code-enum-support/downloads","issues_url":"https://api.github.com/repos/ryotan/code-enum-support/issues{/number}","pulls_url":"https://api.github.com/repos/ryotan/code-enum-support/pulls{/number}","milestones_url":"https://api.github.com/repos/ryotan/code-enum-support/milestones{/number}","notifications_url":"https://api.github.com/repos/ryotan/code-enum-support/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ryotan/code-enum-support/labels{/name}","releases_url":"https://api.github.com/repos/ryotan/code-enum-support/releases{/id}","deployments_url":"https://api.github.com/repos/ryotan/code-enum-support/deployments","created_at":"2016-06-22T09:51:48Z","updated_at":"2016-06-22T14:22:02Z","pushed_at":"2016-06-23T12:21:56Z","git_url":"git://github.com/ryotan/code-enum-support.git","ssh_url":"git@github.com:ryotan/code-enum-support.git","clone_url":"https://github.com/ryotan/code-enum-support.git","svn_url":"https://github.com/ryotan/code-enum-support","homepage":null,"size":33,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ryotan/code-enum-support/pulls/1"},"html":{"href":"https://github.com/ryotan/code-enum-support/pull/1"},"issue":{"href":"https://api.github.com/repos/ryotan/code-enum-support/issues/1"},"comments":{"href":"https://api.github.com/repos/ryotan/code-enum-support/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/ryotan/code-enum-support/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/ryotan/code-enum-support/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ryotan/code-enum-support/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/ryotan/code-enum-support/statuses/242cda8f348ca228851fa5e07edb3b4edc515611"}}}}
{"actor":{"display_login":"ryotan"}}