{"action":"created","comment":{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/comments/41489648","id":41489648,"diff_hunk":"@@ -0,0 +1,113 @@\n+/*\n+ * This file is part of SpongeAPI, licensed under the MIT License (MIT).\n+ *\n+ * Copyright (c) SpongePowered <https://www.spongepowered.org>\n+ * Copyright (c) contributors\n+ *\n+ * Permission is hereby granted, free of charge, to any person obtaining a copy\n+ * of this software and associated documentation files (the \"Software\"), to deal\n+ * in the Software without restriction, including without limitation the rights\n+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+ * copies of the Software, and to permit persons to whom the Software is\n+ * furnished to do so, subject to the following conditions:\n+ *\n+ * The above copyright notice and this permission notice shall be included in\n+ * all copies or substantial portions of the Software.\n+ *\n+ * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n+ * THE SOFTWARE.\n+ */\n+package org.spongepowered.api.text.template;\n+\n+import com.google.common.collect.ImmutableList;\n+import com.google.common.collect.ImmutableMap;\n+\n+public final class TextArgs {\n+\n+    private ImmutableList.Builder<Object> positionedArgsBuilder;\n+    private ImmutableList<Object> positionedArgs = null;\n+    private ImmutableMap.Builder<String, Object> namedArgsBuilder;\n+    private ImmutableMap<String, Object> namedArgs = null;\n+\n+    private TextArgs(ImmutableList.Builder<Object> positionedArgsBuilder,\n+                     ImmutableMap.Builder<String, Object> namedArgsBuilder) {\n+        this.positionedArgsBuilder = positionedArgsBuilder;\n+        this.namedArgsBuilder = namedArgsBuilder;\n+    }\n+\n+    public TextArgs add(Object arg) {\n+        if (positionedArgsBuilder == null) {\n+            throw new IllegalArgumentException(\"Positioned arguments were already accessed, to add\" +\n+                \"more arguments use TextArgs.copy()\");","path":"src/main/java/org/spongepowered/api/text/template/TextArgs.java","position":46,"original_position":46,"commit_id":"88e642a1560405e1302d042d553dcf6689e1392b","original_commit_id":"88e642a1560405e1302d042d553dcf6689e1392b","user":{"login":"Phroa","id":6373176,"avatar_url":"https://avatars.githubusercontent.com/u/6373176?v=3","gravatar_id":"","url":"https://api.github.com/users/Phroa","html_url":"https://github.com/Phroa","followers_url":"https://api.github.com/users/Phroa/followers","following_url":"https://api.github.com/users/Phroa/following{/other_user}","gists_url":"https://api.github.com/users/Phroa/gists{/gist_id}","starred_url":"https://api.github.com/users/Phroa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Phroa/subscriptions","organizations_url":"https://api.github.com/users/Phroa/orgs","repos_url":"https://api.github.com/users/Phroa/repos","events_url":"https://api.github.com/users/Phroa/events{/privacy}","received_events_url":"https://api.github.com/users/Phroa/received_events","type":"User","site_admin":false},"body":"Should have a space after add","created_at":"2015-10-08T08:49:45Z","updated_at":"2015-10-08T08:49:45Z","html_url":"https://github.com/SpongePowered/SpongeAPI/pull/835#discussion_r41489648","pull_request_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/835","_links":{"self":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/comments/41489648"},"html":{"href":"https://github.com/SpongePowered/SpongeAPI/pull/835#discussion_r41489648"},"pull_request":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/835"}}},"pull_request":{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/835","id":44277841,"html_url":"https://github.com/SpongePowered/SpongeAPI/pull/835","diff_url":"https://github.com/SpongePowered/SpongeAPI/pull/835.diff","patch_url":"https://github.com/SpongePowered/SpongeAPI/pull/835.patch","issue_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/835","number":835,"state":"open","locked":false,"title":"[WIP] Text templates","user":{"login":"gratimax","id":1261779,"avatar_url":"https://avatars.githubusercontent.com/u/1261779?v=3","gravatar_id":"","url":"https://api.github.com/users/gratimax","html_url":"https://github.com/gratimax","followers_url":"https://api.github.com/users/gratimax/followers","following_url":"https://api.github.com/users/gratimax/following{/other_user}","gists_url":"https://api.github.com/users/gratimax/gists{/gist_id}","starred_url":"https://api.github.com/users/gratimax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gratimax/subscriptions","organizations_url":"https://api.github.com/users/gratimax/orgs","repos_url":"https://api.github.com/users/gratimax/repos","events_url":"https://api.github.com/users/gratimax/events{/privacy}","received_events_url":"https://api.github.com/users/gratimax/received_events","type":"User","site_admin":false},"body":"See https://gist.github.com/gratimax/9aa7ecc33467e0ddfd0b. More info coming soon.\r\n\r\nHopefully this example can showcase some of the intended power here:\r\n\r\n```java\r\nimport static org.spongepowered.api.text.template.TextElements.*;\r\n\r\nstatic final TextTemplate playerMessage = TextTemplate.of(\r\n  TextColors.BLUE, \"Hello, \", TextColors.LIGHT_GRAY,\r\n  playerDisplayName().pos(0), TextColors.BLUE,\r\n  \"See your team members: \", \r\n  TextColors.LIGHT_GRAY, \r\n    fallback(\r\n      iterable(playerDisplayName(), Texts.of(\"|\")), \r\n      Texts.of(\"No players\")).pos(1), \r\n  TextColors.BLUE, \"!\");\r\n\r\nfor (Player player: players) {\r\n  player.sendMessage(playerMessage.build(\r\n    TextArgs.of(player, players)));\r\n}\r\n```","created_at":"2015-09-05T06:37:25Z","updated_at":"2015-10-08T08:49:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"368b463e11374983c0d7869ad8bb67a7d34c517e","assignee":{"login":"gratimax","id":1261779,"avatar_url":"https://avatars.githubusercontent.com/u/1261779?v=3","gravatar_id":"","url":"https://api.github.com/users/gratimax","html_url":"https://github.com/gratimax","followers_url":"https://api.github.com/users/gratimax/followers","following_url":"https://api.github.com/users/gratimax/following{/other_user}","gists_url":"https://api.github.com/users/gratimax/gists{/gist_id}","starred_url":"https://api.github.com/users/gratimax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gratimax/subscriptions","organizations_url":"https://api.github.com/users/gratimax/orgs","repos_url":"https://api.github.com/users/gratimax/repos","events_url":"https://api.github.com/users/gratimax/events{/privacy}","received_events_url":"https://api.github.com/users/gratimax/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/milestones/4","html_url":"https://github.com/SpongePowered/SpongeAPI/milestones/Revision%203.0","labels_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/milestones/4/labels","id":1082492,"number":4,"title":"Revision 3.0","description":"This is the third stable revision of the Sponge API, 3.0 ","creator":{"login":"Zidane","id":744482,"avatar_url":"https://avatars.githubusercontent.com/u/744482?v=3","gravatar_id":"","url":"https://api.github.com/users/Zidane","html_url":"https://github.com/Zidane","followers_url":"https://api.github.com/users/Zidane/followers","following_url":"https://api.github.com/users/Zidane/following{/other_user}","gists_url":"https://api.github.com/users/Zidane/gists{/gist_id}","starred_url":"https://api.github.com/users/Zidane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zidane/subscriptions","organizations_url":"https://api.github.com/users/Zidane/orgs","repos_url":"https://api.github.com/users/Zidane/repos","events_url":"https://api.github.com/users/Zidane/events{/privacy}","received_events_url":"https://api.github.com/users/Zidane/received_events","type":"User","site_admin":false},"open_issues":19,"closed_issues":52,"state":"open","created_at":"2015-04-24T16:02:08Z","updated_at":"2015-10-07T18:34:32Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/835/commits","review_comments_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/835/comments","review_comment_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/835/comments","statuses_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/statuses/88e642a1560405e1302d042d553dcf6689e1392b","head":{"label":"SpongePowered:text-templates","ref":"text-templates","sha":"88e642a1560405e1302d042d553dcf6689e1392b","user":{"login":"SpongePowered","id":8683473,"avatar_url":"https://avatars.githubusercontent.com/u/8683473?v=3","gravatar_id":"","url":"https://api.github.com/users/SpongePowered","html_url":"https://github.com/SpongePowered","followers_url":"https://api.github.com/users/SpongePowered/followers","following_url":"https://api.github.com/users/SpongePowered/following{/other_user}","gists_url":"https://api.github.com/users/SpongePowered/gists{/gist_id}","starred_url":"https://api.github.com/users/SpongePowered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpongePowered/subscriptions","organizations_url":"https://api.github.com/users/SpongePowered/orgs","repos_url":"https://api.github.com/users/SpongePowered/repos","events_url":"https://api.github.com/users/SpongePowered/events{/privacy}","received_events_url":"https://api.github.com/users/SpongePowered/received_events","type":"Organization","site_admin":false},"repo":{"id":23770421,"name":"SpongeAPI","full_name":"SpongePowered/SpongeAPI","owner":{"login":"SpongePowered","id":8683473,"avatar_url":"https://avatars.githubusercontent.com/u/8683473?v=3","gravatar_id":"","url":"https://api.github.com/users/SpongePowered","html_url":"https://github.com/SpongePowered","followers_url":"https://api.github.com/users/SpongePowered/followers","following_url":"https://api.github.com/users/SpongePowered/following{/other_user}","gists_url":"https://api.github.com/users/SpongePowered/gists{/gist_id}","starred_url":"https://api.github.com/users/SpongePowered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpongePowered/subscriptions","organizations_url":"https://api.github.com/users/SpongePowered/orgs","repos_url":"https://api.github.com/users/SpongePowered/repos","events_url":"https://api.github.com/users/SpongePowered/events{/privacy}","received_events_url":"https://api.github.com/users/SpongePowered/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SpongePowered/SpongeAPI","description":"A Minecraft plugin API","fork":false,"url":"https://api.github.com/repos/SpongePowered/SpongeAPI","forks_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/forks","keys_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/teams","hooks_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/hooks","issue_events_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/events{/number}","events_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/events","assignees_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/assignees{/user}","branches_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/branches{/branch}","tags_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/tags","blobs_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/statuses/{sha}","languages_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/languages","stargazers_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/stargazers","contributors_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/contributors","subscribers_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/subscribers","subscription_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/subscription","commits_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/comments{/number}","contents_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/contents/{+path}","compare_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/merges","archive_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/downloads","issues_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues{/number}","pulls_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls{/number}","milestones_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/milestones{/number}","notifications_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/labels{/name}","releases_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/releases{/id}","created_at":"2014-09-07T20:39:25Z","updated_at":"2015-10-01T12:17:50Z","pushed_at":"2015-10-08T05:48:24Z","git_url":"git://github.com/SpongePowered/SpongeAPI.git","ssh_url":"git@github.com:SpongePowered/SpongeAPI.git","clone_url":"https://github.com/SpongePowered/SpongeAPI.git","svn_url":"https://github.com/SpongePowered/SpongeAPI","homepage":"http://www.spongepowered.org/","size":28392,"stargazers_count":801,"watchers_count":801,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":347,"mirror_url":null,"open_issues_count":105,"forks":347,"open_issues":105,"watchers":801,"default_branch":"master"}},"base":{"label":"SpongePowered:master","ref":"master","sha":"c5859a10fcc96a58eebf23d274ae6a5ece525d8e","user":{"login":"SpongePowered","id":8683473,"avatar_url":"https://avatars.githubusercontent.com/u/8683473?v=3","gravatar_id":"","url":"https://api.github.com/users/SpongePowered","html_url":"https://github.com/SpongePowered","followers_url":"https://api.github.com/users/SpongePowered/followers","following_url":"https://api.github.com/users/SpongePowered/following{/other_user}","gists_url":"https://api.github.com/users/SpongePowered/gists{/gist_id}","starred_url":"https://api.github.com/users/SpongePowered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpongePowered/subscriptions","organizations_url":"https://api.github.com/users/SpongePowered/orgs","repos_url":"https://api.github.com/users/SpongePowered/repos","events_url":"https://api.github.com/users/SpongePowered/events{/privacy}","received_events_url":"https://api.github.com/users/SpongePowered/received_events","type":"Organization","site_admin":false},"repo":{"id":23770421,"name":"SpongeAPI","full_name":"SpongePowered/SpongeAPI","owner":{"login":"SpongePowered","id":8683473,"avatar_url":"https://avatars.githubusercontent.com/u/8683473?v=3","gravatar_id":"","url":"https://api.github.com/users/SpongePowered","html_url":"https://github.com/SpongePowered","followers_url":"https://api.github.com/users/SpongePowered/followers","following_url":"https://api.github.com/users/SpongePowered/following{/other_user}","gists_url":"https://api.github.com/users/SpongePowered/gists{/gist_id}","starred_url":"https://api.github.com/users/SpongePowered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpongePowered/subscriptions","organizations_url":"https://api.github.com/users/SpongePowered/orgs","repos_url":"https://api.github.com/users/SpongePowered/repos","events_url":"https://api.github.com/users/SpongePowered/events{/privacy}","received_events_url":"https://api.github.com/users/SpongePowered/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SpongePowered/SpongeAPI","description":"A Minecraft plugin API","fork":false,"url":"https://api.github.com/repos/SpongePowered/SpongeAPI","forks_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/forks","keys_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/teams","hooks_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/hooks","issue_events_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/events{/number}","events_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/events","assignees_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/assignees{/user}","branches_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/branches{/branch}","tags_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/tags","blobs_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/statuses/{sha}","languages_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/languages","stargazers_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/stargazers","contributors_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/contributors","subscribers_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/subscribers","subscription_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/subscription","commits_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/comments{/number}","contents_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/contents/{+path}","compare_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/merges","archive_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/downloads","issues_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues{/number}","pulls_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls{/number}","milestones_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/milestones{/number}","notifications_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/labels{/name}","releases_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/releases{/id}","created_at":"2014-09-07T20:39:25Z","updated_at":"2015-10-01T12:17:50Z","pushed_at":"2015-10-08T05:48:24Z","git_url":"git://github.com/SpongePowered/SpongeAPI.git","ssh_url":"git@github.com:SpongePowered/SpongeAPI.git","clone_url":"https://github.com/SpongePowered/SpongeAPI.git","svn_url":"https://github.com/SpongePowered/SpongeAPI","homepage":"http://www.spongepowered.org/","size":28392,"stargazers_count":801,"watchers_count":801,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":347,"mirror_url":null,"open_issues_count":105,"forks":347,"open_issues":105,"watchers":801,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/835"},"html":{"href":"https://github.com/SpongePowered/SpongeAPI/pull/835"},"issue":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/835"},"comments":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/835/comments"},"review_comments":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/835/comments"},"review_comment":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/835/commits"},"statuses":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/statuses/88e642a1560405e1302d042d553dcf6689e1392b"}}}}