{"action":"created","comment":{"url":"https://api.github.com/repos/SpineEventEngine/examples-java/pulls/comments/173914244","pull_request_review_id":103181213,"id":173914244,"diff_hunk":"@@ -0,0 +1,198 @@\n+/*\n+ * Copyright 2018, TeamDev Ltd. All rights reserved.\n+ *\n+ * Redistribution and use in source and/or binary forms, with or without\n+ * modification, must retain the above copyright notice and the following\n+ * disclaimer.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+package io.spine.examples.tuple;\n+\n+import com.google.common.base.Optional;\n+\n+import static io.spine.util.Exceptions.newIllegalArgumentException;\n+import static io.spine.util.Exceptions.newIllegalStateException;\n+\n+/**\n+ * Lists Kanban board columns with operations available with them.\n+ * \n+ * @author Mykhailo Drachuk\n+ */\n+enum Column {\n+    \n+    TODO {\n+        @Override\n+        boolean contains(TaskId taskId, KanbanBoardOrBuilder board) {\n+            return board.getTodoList()\n+                        .contains(taskId);\n+        }\n+\n+        @Override\n+        boolean remove(TaskId taskId, KanbanBoardVBuilder board) {\n+            final int taskIndex = board.getTodo()\n+                                       .indexOf(taskId);\n+            if (taskIndex == -1) {\n+                return false;\n+            }\n+            board.removeTodo(taskIndex);\n+            return true;\n+        }\n+\n+        @Override\n+        void add(TaskId taskId, KanbanBoardVBuilder board) {\n+            board.addTodo(taskId);\n+        }\n+\n+        @Override\n+        KanbanBoard.Column column() {\n+            return KanbanBoard.Column.TODO;","path":"server-examples/src/main/java/io/spine/examples/tuple/Column.java","position":60,"original_position":60,"commit_id":"331ba8162771d710f4d893744b1d9e735f7e3cad","original_commit_id":"02abe0c5ad32397c24d9c44cbf1e373c3a4df251","user":{"login":"alexander-yevsyukov","id":3116444,"avatar_url":"https://avatars1.githubusercontent.com/u/3116444?v=4","gravatar_id":"","url":"https://api.github.com/users/alexander-yevsyukov","html_url":"https://github.com/alexander-yevsyukov","followers_url":"https://api.github.com/users/alexander-yevsyukov/followers","following_url":"https://api.github.com/users/alexander-yevsyukov/following{/other_user}","gists_url":"https://api.github.com/users/alexander-yevsyukov/gists{/gist_id}","starred_url":"https://api.github.com/users/alexander-yevsyukov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexander-yevsyukov/subscriptions","organizations_url":"https://api.github.com/users/alexander-yevsyukov/orgs","repos_url":"https://api.github.com/users/alexander-yevsyukov/repos","events_url":"https://api.github.com/users/alexander-yevsyukov/events{/privacy}","received_events_url":"https://api.github.com/users/alexander-yevsyukov/received_events","type":"User","site_admin":false},"body":"Why cannot this be a value passed to the constructor?","created_at":"2018-03-12T19:11:04Z","updated_at":"2018-03-12T19:42:56Z","html_url":"https://github.com/SpineEventEngine/examples-java/pull/12#discussion_r173914244","pull_request_url":"https://api.github.com/repos/SpineEventEngine/examples-java/pulls/12","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/SpineEventEngine/examples-java/pulls/comments/173914244"},"html":{"href":"https://github.com/SpineEventEngine/examples-java/pull/12#discussion_r173914244"},"pull_request":{"href":"https://api.github.com/repos/SpineEventEngine/examples-java/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/SpineEventEngine/examples-java/pulls/12","id":169833479,"html_url":"https://github.com/SpineEventEngine/examples-java/pull/12","diff_url":"https://github.com/SpineEventEngine/examples-java/pull/12.diff","patch_url":"https://github.com/SpineEventEngine/examples-java/pull/12.patch","issue_url":"https://api.github.com/repos/SpineEventEngine/examples-java/issues/12","number":12,"state":"open","locked":false,"title":"Implement tuple examples","user":{"login":"mdrachuk","id":9073528,"avatar_url":"https://avatars1.githubusercontent.com/u/9073528?v=4","gravatar_id":"","url":"https://api.github.com/users/mdrachuk","html_url":"https://github.com/mdrachuk","followers_url":"https://api.github.com/users/mdrachuk/followers","following_url":"https://api.github.com/users/mdrachuk/following{/other_user}","gists_url":"https://api.github.com/users/mdrachuk/gists{/gist_id}","starred_url":"https://api.github.com/users/mdrachuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdrachuk/subscriptions","organizations_url":"https://api.github.com/users/mdrachuk/orgs","repos_url":"https://api.github.com/users/mdrachuk/repos","events_url":"https://api.github.com/users/mdrachuk/events{/privacy}","received_events_url":"https://api.github.com/users/mdrachuk/received_events","type":"User","site_admin":false},"body":"This PR tackles the issue #9, adding an example for `Pair` and `EitherOfThree` tuples.\r\n\r\nAn example is implemented as a task aggregate and covered with tests.\r\n\r\nFor the `Pair` example, two events are fired upon `CreateTask` command: `TaskCreated` and `TaskAssigned`. The second event is fired only when the command held an assignee for a new task.\r\n\r\nAs for the `EitherOfThree` example, the `StopTask` command is executed, and depending on its reason either one of three events is fired: `TaskCompleted`, `TaskCanceled` or `TaskPaused`.\r\n","created_at":"2018-02-18T14:46:44Z","updated_at":"2018-03-12T19:42:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a4e55c9c09a029b33c504eaab2dd98617c4fc7fd","assignee":{"login":"mdrachuk","id":9073528,"avatar_url":"https://avatars1.githubusercontent.com/u/9073528?v=4","gravatar_id":"","url":"https://api.github.com/users/mdrachuk","html_url":"https://github.com/mdrachuk","followers_url":"https://api.github.com/users/mdrachuk/followers","following_url":"https://api.github.com/users/mdrachuk/following{/other_user}","gists_url":"https://api.github.com/users/mdrachuk/gists{/gist_id}","starred_url":"https://api.github.com/users/mdrachuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdrachuk/subscriptions","organizations_url":"https://api.github.com/users/mdrachuk/orgs","repos_url":"https://api.github.com/users/mdrachuk/repos","events_url":"https://api.github.com/users/mdrachuk/events{/privacy}","received_events_url":"https://api.github.com/users/mdrachuk/received_events","type":"User","site_admin":false},"assignees":[{"login":"mdrachuk","id":9073528,"avatar_url":"https://avatars1.githubusercontent.com/u/9073528?v=4","gravatar_id":"","url":"https://api.github.com/users/mdrachuk","html_url":"https://github.com/mdrachuk","followers_url":"https://api.github.com/users/mdrachuk/followers","following_url":"https://api.github.com/users/mdrachuk/following{/other_user}","gists_url":"https://api.github.com/users/mdrachuk/gists{/gist_id}","starred_url":"https://api.github.com/users/mdrachuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdrachuk/subscriptions","organizations_url":"https://api.github.com/users/mdrachuk/orgs","repos_url":"https://api.github.com/users/mdrachuk/repos","events_url":"https://api.github.com/users/mdrachuk/events{/privacy}","received_events_url":"https://api.github.com/users/mdrachuk/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/SpineEventEngine/examples-java/pulls/12/commits","review_comments_url":"https://api.github.com/repos/SpineEventEngine/examples-java/pulls/12/comments","review_comment_url":"https://api.github.com/repos/SpineEventEngine/examples-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SpineEventEngine/examples-java/issues/12/comments","statuses_url":"https://api.github.com/repos/SpineEventEngine/examples-java/statuses/331ba8162771d710f4d893744b1d9e735f7e3cad","head":{"label":"SpineEventEngine:tuple-examples","ref":"tuple-examples","sha":"331ba8162771d710f4d893744b1d9e735f7e3cad","user":{"login":"SpineEventEngine","id":12821626,"avatar_url":"https://avatars3.githubusercontent.com/u/12821626?v=4","gravatar_id":"","url":"https://api.github.com/users/SpineEventEngine","html_url":"https://github.com/SpineEventEngine","followers_url":"https://api.github.com/users/SpineEventEngine/followers","following_url":"https://api.github.com/users/SpineEventEngine/following{/other_user}","gists_url":"https://api.github.com/users/SpineEventEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/SpineEventEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpineEventEngine/subscriptions","organizations_url":"https://api.github.com/users/SpineEventEngine/orgs","repos_url":"https://api.github.com/users/SpineEventEngine/repos","events_url":"https://api.github.com/users/SpineEventEngine/events{/privacy}","received_events_url":"https://api.github.com/users/SpineEventEngine/received_events","type":"Organization","site_admin":false},"repo":{"id":65474400,"name":"examples-java","full_name":"SpineEventEngine/examples-java","owner":{"login":"SpineEventEngine","id":12821626,"avatar_url":"https://avatars3.githubusercontent.com/u/12821626?v=4","gravatar_id":"","url":"https://api.github.com/users/SpineEventEngine","html_url":"https://github.com/SpineEventEngine","followers_url":"https://api.github.com/users/SpineEventEngine/followers","following_url":"https://api.github.com/users/SpineEventEngine/following{/other_user}","gists_url":"https://api.github.com/users/SpineEventEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/SpineEventEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpineEventEngine/subscriptions","organizations_url":"https://api.github.com/users/SpineEventEngine/orgs","repos_url":"https://api.github.com/users/SpineEventEngine/repos","events_url":"https://api.github.com/users/SpineEventEngine/events{/privacy}","received_events_url":"https://api.github.com/users/SpineEventEngine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SpineEventEngine/examples-java","description":"Examples of using the framework from Java","fork":false,"url":"https://api.github.com/repos/SpineEventEngine/examples-java","forks_url":"https://api.github.com/repos/SpineEventEngine/examples-java/forks","keys_url":"https://api.github.com/repos/SpineEventEngine/examples-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpineEventEngine/examples-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpineEventEngine/examples-java/teams","hooks_url":"https://api.github.com/repos/SpineEventEngine/examples-java/hooks","issue_events_url":"https://api.github.com/repos/SpineEventEngine/examples-java/issues/events{/number}","events_url":"https://api.github.com/repos/SpineEventEngine/examples-java/events","assignees_url":"https://api.github.com/repos/SpineEventEngine/examples-java/assignees{/user}","branches_url":"https://api.github.com/repos/SpineEventEngine/examples-java/branches{/branch}","tags_url":"https://api.github.com/repos/SpineEventEngine/examples-java/tags","blobs_url":"https://api.github.com/repos/SpineEventEngine/examples-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpineEventEngine/examples-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpineEventEngine/examples-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpineEventEngine/examples-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpineEventEngine/examples-java/statuses/{sha}","languages_url":"https://api.github.com/repos/SpineEventEngine/examples-java/languages","stargazers_url":"https://api.github.com/repos/SpineEventEngine/examples-java/stargazers","contributors_url":"https://api.github.com/repos/SpineEventEngine/examples-java/contributors","subscribers_url":"https://api.github.com/repos/SpineEventEngine/examples-java/subscribers","subscription_url":"https://api.github.com/repos/SpineEventEngine/examples-java/subscription","commits_url":"https://api.github.com/repos/SpineEventEngine/examples-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpineEventEngine/examples-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpineEventEngine/examples-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpineEventEngine/examples-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/SpineEventEngine/examples-java/contents/{+path}","compare_url":"https://api.github.com/repos/SpineEventEngine/examples-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpineEventEngine/examples-java/merges","archive_url":"https://api.github.com/repos/SpineEventEngine/examples-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpineEventEngine/examples-java/downloads","issues_url":"https://api.github.com/repos/SpineEventEngine/examples-java/issues{/number}","pulls_url":"https://api.github.com/repos/SpineEventEngine/examples-java/pulls{/number}","milestones_url":"https://api.github.com/repos/SpineEventEngine/examples-java/milestones{/number}","notifications_url":"https://api.github.com/repos/SpineEventEngine/examples-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpineEventEngine/examples-java/labels{/name}","releases_url":"https://api.github.com/repos/SpineEventEngine/examples-java/releases{/id}","deployments_url":"https://api.github.com/repos/SpineEventEngine/examples-java/deployments","created_at":"2016-08-11T14:06:24Z","updated_at":"2018-03-12T19:08:36Z","pushed_at":"2018-03-12T10:40:57Z","git_url":"git://github.com/SpineEventEngine/examples-java.git","ssh_url":"git@github.com:SpineEventEngine/examples-java.git","clone_url":"https://github.com/SpineEventEngine/examples-java.git","svn_url":"https://github.com/SpineEventEngine/examples-java","homepage":null,"size":402,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":5,"watchers":4,"default_branch":"master"}},"base":{"label":"SpineEventEngine:master","ref":"master","sha":"150bd552ac58847b9004dd3af8552d4350d7242d","user":{"login":"SpineEventEngine","id":12821626,"avatar_url":"https://avatars3.githubusercontent.com/u/12821626?v=4","gravatar_id":"","url":"https://api.github.com/users/SpineEventEngine","html_url":"https://github.com/SpineEventEngine","followers_url":"https://api.github.com/users/SpineEventEngine/followers","following_url":"https://api.github.com/users/SpineEventEngine/following{/other_user}","gists_url":"https://api.github.com/users/SpineEventEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/SpineEventEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpineEventEngine/subscriptions","organizations_url":"https://api.github.com/users/SpineEventEngine/orgs","repos_url":"https://api.github.com/users/SpineEventEngine/repos","events_url":"https://api.github.com/users/SpineEventEngine/events{/privacy}","received_events_url":"https://api.github.com/users/SpineEventEngine/received_events","type":"Organization","site_admin":false},"repo":{"id":65474400,"name":"examples-java","full_name":"SpineEventEngine/examples-java","owner":{"login":"SpineEventEngine","id":12821626,"avatar_url":"https://avatars3.githubusercontent.com/u/12821626?v=4","gravatar_id":"","url":"https://api.github.com/users/SpineEventEngine","html_url":"https://github.com/SpineEventEngine","followers_url":"https://api.github.com/users/SpineEventEngine/followers","following_url":"https://api.github.com/users/SpineEventEngine/following{/other_user}","gists_url":"https://api.github.com/users/SpineEventEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/SpineEventEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpineEventEngine/subscriptions","organizations_url":"https://api.github.com/users/SpineEventEngine/orgs","repos_url":"https://api.github.com/users/SpineEventEngine/repos","events_url":"https://api.github.com/users/SpineEventEngine/events{/privacy}","received_events_url":"https://api.github.com/users/SpineEventEngine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SpineEventEngine/examples-java","description":"Examples of using the framework from Java","fork":false,"url":"https://api.github.com/repos/SpineEventEngine/examples-java","forks_url":"https://api.github.com/repos/SpineEventEngine/examples-java/forks","keys_url":"https://api.github.com/repos/SpineEventEngine/examples-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpineEventEngine/examples-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpineEventEngine/examples-java/teams","hooks_url":"https://api.github.com/repos/SpineEventEngine/examples-java/hooks","issue_events_url":"https://api.github.com/repos/SpineEventEngine/examples-java/issues/events{/number}","events_url":"https://api.github.com/repos/SpineEventEngine/examples-java/events","assignees_url":"https://api.github.com/repos/SpineEventEngine/examples-java/assignees{/user}","branches_url":"https://api.github.com/repos/SpineEventEngine/examples-java/branches{/branch}","tags_url":"https://api.github.com/repos/SpineEventEngine/examples-java/tags","blobs_url":"https://api.github.com/repos/SpineEventEngine/examples-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpineEventEngine/examples-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpineEventEngine/examples-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpineEventEngine/examples-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpineEventEngine/examples-java/statuses/{sha}","languages_url":"https://api.github.com/repos/SpineEventEngine/examples-java/languages","stargazers_url":"https://api.github.com/repos/SpineEventEngine/examples-java/stargazers","contributors_url":"https://api.github.com/repos/SpineEventEngine/examples-java/contributors","subscribers_url":"https://api.github.com/repos/SpineEventEngine/examples-java/subscribers","subscription_url":"https://api.github.com/repos/SpineEventEngine/examples-java/subscription","commits_url":"https://api.github.com/repos/SpineEventEngine/examples-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpineEventEngine/examples-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpineEventEngine/examples-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpineEventEngine/examples-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/SpineEventEngine/examples-java/contents/{+path}","compare_url":"https://api.github.com/repos/SpineEventEngine/examples-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpineEventEngine/examples-java/merges","archive_url":"https://api.github.com/repos/SpineEventEngine/examples-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpineEventEngine/examples-java/downloads","issues_url":"https://api.github.com/repos/SpineEventEngine/examples-java/issues{/number}","pulls_url":"https://api.github.com/repos/SpineEventEngine/examples-java/pulls{/number}","milestones_url":"https://api.github.com/repos/SpineEventEngine/examples-java/milestones{/number}","notifications_url":"https://api.github.com/repos/SpineEventEngine/examples-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpineEventEngine/examples-java/labels{/name}","releases_url":"https://api.github.com/repos/SpineEventEngine/examples-java/releases{/id}","deployments_url":"https://api.github.com/repos/SpineEventEngine/examples-java/deployments","created_at":"2016-08-11T14:06:24Z","updated_at":"2018-03-12T19:08:36Z","pushed_at":"2018-03-12T10:40:57Z","git_url":"git://github.com/SpineEventEngine/examples-java.git","ssh_url":"git@github.com:SpineEventEngine/examples-java.git","clone_url":"https://github.com/SpineEventEngine/examples-java.git","svn_url":"https://github.com/SpineEventEngine/examples-java","homepage":null,"size":402,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":5,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SpineEventEngine/examples-java/pulls/12"},"html":{"href":"https://github.com/SpineEventEngine/examples-java/pull/12"},"issue":{"href":"https://api.github.com/repos/SpineEventEngine/examples-java/issues/12"},"comments":{"href":"https://api.github.com/repos/SpineEventEngine/examples-java/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/SpineEventEngine/examples-java/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/SpineEventEngine/examples-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SpineEventEngine/examples-java/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/SpineEventEngine/examples-java/statuses/331ba8162771d710f4d893744b1d9e735f7e3cad"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"alexander-yevsyukov"}}