{"action":"created","comment":{"url":"https://api.github.com/repos/unacceptable/unacceptable/pulls/comments/45008632","id":45008632,"diff_hunk":"@@ -0,0 +1,41 @@\n+package io.github.unacceptable.alias;\n+\n+public abstract class AbstractStringGenerator implements Generator<String> {\n+\n+    public static final String ABSENT = \"ABSENT\";\n+\n+    /**\n+     * Generates a String value for an alias. Suitable for things like usernames, email addresses, and passwords.\n+     * <p>\n+     * First, {@code null} alias are returned as-is.\n+     * <p>\n+     * Then, if the alias is {@value #ABSENT}, the resulting value is {@code null}.\n+     * <p>\n+     * Then, aliases wrapped in \"&lt;\" and \"&gt;\" <em>at the ends only</em> are treated as literal, and will be returned\n+     * without translation, with the brackets removed.\n+     * <p>\n+     * Then, aliases that are an empty string are returned as-is.\n+     * <p>\n+     * Finally, if none of those happen, {@link #reallyGenerate(String)} will be called to generate a new value.\n+     */\n+    public String generate(String alias) {\n+        if (alias == null) {\n+            return null;\n+        }\n+        if (alias.equals(ABSENT)) {\n+            return null;\n+        }\n+        if (alias.startsWith(\"<\") && alias.endsWith(\">\")) {\n+            // If T is not a string, this will fail.","path":"unacceptable-aliases/src/main/java/io/github/unacceptable/alias/AbstractStringGenerator.java","position":29,"original_position":29,"commit_id":"619441369577a7795e3e2bff68d42e6f131f4c4e","original_commit_id":"619441369577a7795e3e2bff68d42e6f131f4c4e","user":{"login":"ojacobson","id":160985,"avatar_url":"https://avatars.githubusercontent.com/u/160985?v=3","gravatar_id":"","url":"https://api.github.com/users/ojacobson","html_url":"https://github.com/ojacobson","followers_url":"https://api.github.com/users/ojacobson/followers","following_url":"https://api.github.com/users/ojacobson/following{/other_user}","gists_url":"https://api.github.com/users/ojacobson/gists{/gist_id}","starred_url":"https://api.github.com/users/ojacobson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ojacobson/subscriptions","organizations_url":"https://api.github.com/users/ojacobson/orgs","repos_url":"https://api.github.com/users/ojacobson/repos","events_url":"https://api.github.com/users/ojacobson/events{/privacy}","received_events_url":"https://api.github.com/users/ojacobson/received_events","type":"User","site_admin":false},"body":"Copypasta damage? There's no `T` here that I can find.","created_at":"2015-11-17T00:51:01Z","updated_at":"2015-11-17T00:51:01Z","html_url":"https://github.com/unacceptable/unacceptable/pull/29#discussion_r45008632","pull_request_url":"https://api.github.com/repos/unacceptable/unacceptable/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/unacceptable/unacceptable/pulls/comments/45008632"},"html":{"href":"https://github.com/unacceptable/unacceptable/pull/29#discussion_r45008632"},"pull_request":{"href":"https://api.github.com/repos/unacceptable/unacceptable/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/unacceptable/unacceptable/pulls/29","id":50730433,"html_url":"https://github.com/unacceptable/unacceptable/pull/29","diff_url":"https://github.com/unacceptable/unacceptable/pull/29.diff","patch_url":"https://github.com/unacceptable/unacceptable/pull/29.patch","issue_url":"https://api.github.com/repos/unacceptable/unacceptable/issues/29","number":29,"state":"open","locked":false,"title":"Making `AliasStore` suitable for holding things other than Strings.","user":{"login":"lewisd32","id":1637393,"avatar_url":"https://avatars.githubusercontent.com/u/1637393?v=3","gravatar_id":"","url":"https://api.github.com/users/lewisd32","html_url":"https://github.com/lewisd32","followers_url":"https://api.github.com/users/lewisd32/followers","following_url":"https://api.github.com/users/lewisd32/following{/other_user}","gists_url":"https://api.github.com/users/lewisd32/gists{/gist_id}","starred_url":"https://api.github.com/users/lewisd32/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lewisd32/subscriptions","organizations_url":"https://api.github.com/users/lewisd32/orgs","repos_url":"https://api.github.com/users/lewisd32/repos","events_url":"https://api.github.com/users/lewisd32/events{/privacy}","received_events_url":"https://api.github.com/users/lewisd32/received_events","type":"User","site_admin":false},"body":"This pushes the literal (`\"<foo>\"`) and ABSENT handling into the `Generator`.\r\nI've introduced `AbstractStringGenerator` that the existing generators\r\nall extend, to share this logic.","created_at":"2015-11-14T19:42:27Z","updated_at":"2015-11-17T00:51:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bbb2e67572fbeedcd3ad5e0baf899f0be9e529eb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/unacceptable/unacceptable/pulls/29/commits","review_comments_url":"https://api.github.com/repos/unacceptable/unacceptable/pulls/29/comments","review_comment_url":"https://api.github.com/repos/unacceptable/unacceptable/pulls/comments{/number}","comments_url":"https://api.github.com/repos/unacceptable/unacceptable/issues/29/comments","statuses_url":"https://api.github.com/repos/unacceptable/unacceptable/statuses/619441369577a7795e3e2bff68d42e6f131f4c4e","head":{"label":"unacceptable:generic-alias-store","ref":"generic-alias-store","sha":"619441369577a7795e3e2bff68d42e6f131f4c4e","user":{"login":"unacceptable","id":15718379,"avatar_url":"https://avatars.githubusercontent.com/u/15718379?v=3","gravatar_id":"","url":"https://api.github.com/users/unacceptable","html_url":"https://github.com/unacceptable","followers_url":"https://api.github.com/users/unacceptable/followers","following_url":"https://api.github.com/users/unacceptable/following{/other_user}","gists_url":"https://api.github.com/users/unacceptable/gists{/gist_id}","starred_url":"https://api.github.com/users/unacceptable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unacceptable/subscriptions","organizations_url":"https://api.github.com/users/unacceptable/orgs","repos_url":"https://api.github.com/users/unacceptable/repos","events_url":"https://api.github.com/users/unacceptable/events{/privacy}","received_events_url":"https://api.github.com/users/unacceptable/received_events","type":"Organization","site_admin":false},"repo":{"id":45793481,"name":"unacceptable","full_name":"unacceptable/unacceptable","owner":{"login":"unacceptable","id":15718379,"avatar_url":"https://avatars.githubusercontent.com/u/15718379?v=3","gravatar_id":"","url":"https://api.github.com/users/unacceptable","html_url":"https://github.com/unacceptable","followers_url":"https://api.github.com/users/unacceptable/followers","following_url":"https://api.github.com/users/unacceptable/following{/other_user}","gists_url":"https://api.github.com/users/unacceptable/gists{/gist_id}","starred_url":"https://api.github.com/users/unacceptable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unacceptable/subscriptions","organizations_url":"https://api.github.com/users/unacceptable/orgs","repos_url":"https://api.github.com/users/unacceptable/repos","events_url":"https://api.github.com/users/unacceptable/events{/privacy}","received_events_url":"https://api.github.com/users/unacceptable/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/unacceptable/unacceptable","description":null,"fork":false,"url":"https://api.github.com/repos/unacceptable/unacceptable","forks_url":"https://api.github.com/repos/unacceptable/unacceptable/forks","keys_url":"https://api.github.com/repos/unacceptable/unacceptable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/unacceptable/unacceptable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/unacceptable/unacceptable/teams","hooks_url":"https://api.github.com/repos/unacceptable/unacceptable/hooks","issue_events_url":"https://api.github.com/repos/unacceptable/unacceptable/issues/events{/number}","events_url":"https://api.github.com/repos/unacceptable/unacceptable/events","assignees_url":"https://api.github.com/repos/unacceptable/unacceptable/assignees{/user}","branches_url":"https://api.github.com/repos/unacceptable/unacceptable/branches{/branch}","tags_url":"https://api.github.com/repos/unacceptable/unacceptable/tags","blobs_url":"https://api.github.com/repos/unacceptable/unacceptable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/unacceptable/unacceptable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/unacceptable/unacceptable/git/refs{/sha}","trees_url":"https://api.github.com/repos/unacceptable/unacceptable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/unacceptable/unacceptable/statuses/{sha}","languages_url":"https://api.github.com/repos/unacceptable/unacceptable/languages","stargazers_url":"https://api.github.com/repos/unacceptable/unacceptable/stargazers","contributors_url":"https://api.github.com/repos/unacceptable/unacceptable/contributors","subscribers_url":"https://api.github.com/repos/unacceptable/unacceptable/subscribers","subscription_url":"https://api.github.com/repos/unacceptable/unacceptable/subscription","commits_url":"https://api.github.com/repos/unacceptable/unacceptable/commits{/sha}","git_commits_url":"https://api.github.com/repos/unacceptable/unacceptable/git/commits{/sha}","comments_url":"https://api.github.com/repos/unacceptable/unacceptable/comments{/number}","issue_comment_url":"https://api.github.com/repos/unacceptable/unacceptable/issues/comments{/number}","contents_url":"https://api.github.com/repos/unacceptable/unacceptable/contents/{+path}","compare_url":"https://api.github.com/repos/unacceptable/unacceptable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/unacceptable/unacceptable/merges","archive_url":"https://api.github.com/repos/unacceptable/unacceptable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/unacceptable/unacceptable/downloads","issues_url":"https://api.github.com/repos/unacceptable/unacceptable/issues{/number}","pulls_url":"https://api.github.com/repos/unacceptable/unacceptable/pulls{/number}","milestones_url":"https://api.github.com/repos/unacceptable/unacceptable/milestones{/number}","notifications_url":"https://api.github.com/repos/unacceptable/unacceptable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/unacceptable/unacceptable/labels{/name}","releases_url":"https://api.github.com/repos/unacceptable/unacceptable/releases{/id}","created_at":"2015-11-08T18:40:31Z","updated_at":"2015-11-17T00:48:45Z","pushed_at":"2015-11-14T19:42:28Z","git_url":"git://github.com/unacceptable/unacceptable.git","ssh_url":"git@github.com:unacceptable/unacceptable.git","clone_url":"https://github.com/unacceptable/unacceptable.git","svn_url":"https://github.com/unacceptable/unacceptable","homepage":null,"size":328,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":1,"default_branch":"master"}},"base":{"label":"unacceptable:master","ref":"master","sha":"d5bc9e7818595a2d2444814d54eb0b18ea1b272f","user":{"login":"unacceptable","id":15718379,"avatar_url":"https://avatars.githubusercontent.com/u/15718379?v=3","gravatar_id":"","url":"https://api.github.com/users/unacceptable","html_url":"https://github.com/unacceptable","followers_url":"https://api.github.com/users/unacceptable/followers","following_url":"https://api.github.com/users/unacceptable/following{/other_user}","gists_url":"https://api.github.com/users/unacceptable/gists{/gist_id}","starred_url":"https://api.github.com/users/unacceptable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unacceptable/subscriptions","organizations_url":"https://api.github.com/users/unacceptable/orgs","repos_url":"https://api.github.com/users/unacceptable/repos","events_url":"https://api.github.com/users/unacceptable/events{/privacy}","received_events_url":"https://api.github.com/users/unacceptable/received_events","type":"Organization","site_admin":false},"repo":{"id":45793481,"name":"unacceptable","full_name":"unacceptable/unacceptable","owner":{"login":"unacceptable","id":15718379,"avatar_url":"https://avatars.githubusercontent.com/u/15718379?v=3","gravatar_id":"","url":"https://api.github.com/users/unacceptable","html_url":"https://github.com/unacceptable","followers_url":"https://api.github.com/users/unacceptable/followers","following_url":"https://api.github.com/users/unacceptable/following{/other_user}","gists_url":"https://api.github.com/users/unacceptable/gists{/gist_id}","starred_url":"https://api.github.com/users/unacceptable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unacceptable/subscriptions","organizations_url":"https://api.github.com/users/unacceptable/orgs","repos_url":"https://api.github.com/users/unacceptable/repos","events_url":"https://api.github.com/users/unacceptable/events{/privacy}","received_events_url":"https://api.github.com/users/unacceptable/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/unacceptable/unacceptable","description":null,"fork":false,"url":"https://api.github.com/repos/unacceptable/unacceptable","forks_url":"https://api.github.com/repos/unacceptable/unacceptable/forks","keys_url":"https://api.github.com/repos/unacceptable/unacceptable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/unacceptable/unacceptable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/unacceptable/unacceptable/teams","hooks_url":"https://api.github.com/repos/unacceptable/unacceptable/hooks","issue_events_url":"https://api.github.com/repos/unacceptable/unacceptable/issues/events{/number}","events_url":"https://api.github.com/repos/unacceptable/unacceptable/events","assignees_url":"https://api.github.com/repos/unacceptable/unacceptable/assignees{/user}","branches_url":"https://api.github.com/repos/unacceptable/unacceptable/branches{/branch}","tags_url":"https://api.github.com/repos/unacceptable/unacceptable/tags","blobs_url":"https://api.github.com/repos/unacceptable/unacceptable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/unacceptable/unacceptable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/unacceptable/unacceptable/git/refs{/sha}","trees_url":"https://api.github.com/repos/unacceptable/unacceptable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/unacceptable/unacceptable/statuses/{sha}","languages_url":"https://api.github.com/repos/unacceptable/unacceptable/languages","stargazers_url":"https://api.github.com/repos/unacceptable/unacceptable/stargazers","contributors_url":"https://api.github.com/repos/unacceptable/unacceptable/contributors","subscribers_url":"https://api.github.com/repos/unacceptable/unacceptable/subscribers","subscription_url":"https://api.github.com/repos/unacceptable/unacceptable/subscription","commits_url":"https://api.github.com/repos/unacceptable/unacceptable/commits{/sha}","git_commits_url":"https://api.github.com/repos/unacceptable/unacceptable/git/commits{/sha}","comments_url":"https://api.github.com/repos/unacceptable/unacceptable/comments{/number}","issue_comment_url":"https://api.github.com/repos/unacceptable/unacceptable/issues/comments{/number}","contents_url":"https://api.github.com/repos/unacceptable/unacceptable/contents/{+path}","compare_url":"https://api.github.com/repos/unacceptable/unacceptable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/unacceptable/unacceptable/merges","archive_url":"https://api.github.com/repos/unacceptable/unacceptable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/unacceptable/unacceptable/downloads","issues_url":"https://api.github.com/repos/unacceptable/unacceptable/issues{/number}","pulls_url":"https://api.github.com/repos/unacceptable/unacceptable/pulls{/number}","milestones_url":"https://api.github.com/repos/unacceptable/unacceptable/milestones{/number}","notifications_url":"https://api.github.com/repos/unacceptable/unacceptable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/unacceptable/unacceptable/labels{/name}","releases_url":"https://api.github.com/repos/unacceptable/unacceptable/releases{/id}","created_at":"2015-11-08T18:40:31Z","updated_at":"2015-11-17T00:48:45Z","pushed_at":"2015-11-14T19:42:28Z","git_url":"git://github.com/unacceptable/unacceptable.git","ssh_url":"git@github.com:unacceptable/unacceptable.git","clone_url":"https://github.com/unacceptable/unacceptable.git","svn_url":"https://github.com/unacceptable/unacceptable","homepage":null,"size":328,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/unacceptable/unacceptable/pulls/29"},"html":{"href":"https://github.com/unacceptable/unacceptable/pull/29"},"issue":{"href":"https://api.github.com/repos/unacceptable/unacceptable/issues/29"},"comments":{"href":"https://api.github.com/repos/unacceptable/unacceptable/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/unacceptable/unacceptable/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/unacceptable/unacceptable/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/unacceptable/unacceptable/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/unacceptable/unacceptable/statuses/619441369577a7795e3e2bff68d42e6f131f4c4e"}}}}