{"action":"created","comment":{"url":"https://api.github.com/repos/dimandus/Epam_six_task/pulls/comments/46325757","id":46325757,"diff_hunk":"@@ -0,0 +1,62 @@\n+import org.apache.commons.cli.*;\n+\n+import java.util.Objects;\n+\n+class Parser {\n+    private int left;\n+    private int right;\n+    private Operation operation;\n+\n+    public Parser(String[] args) throws ParseException {\n+        Options clOptions = new Options();\n+\n+        Option leftOperand = new Option(\"l\", \"leftOperand\", true, \"Left operand\");\n+        leftOperand.setArgs(1);\n+        leftOperand.setArgName(\"LeftOperand \");\n+        clOptions.addOption(leftOperand);\n+\n+        Option rightOperand = new Option(\"r\", \"rightOperand\", true, \"Right operand\");\n+        rightOperand.setArgs(1);\n+        rightOperand.setArgName(\"RightOperand \");\n+\n+        clOptions.addOption(rightOperand);\n+\n+        Option inputOperation = new Option(\"o\", \"operation\", true, \"operation\");\n+        inputOperation.setArgs(1);\n+        inputOperation.setArgName(\"operation \");\n+\n+        clOptions.addOption(inputOperation);\n+\n+        CommandLineParser cmdLinePosixParser = new DefaultParser();\n+        org.apache.commons.cli.CommandLine commandLine = cmdLinePosixParser.parse(clOptions, args);\n+\n+        left = Integer.decode(commandLine.getOptionValue(\"l\"));\n+        right = Integer.decode(commandLine.getOptionValue(\"r\"));\n+        operation = chooseOperation(commandLine.getOptionValue(\"o\"));\n+    }\n+\n+    public int getLeft() {\n+        return left;\n+    }\n+\n+    public int getRight() {\n+        return right;\n+    }\n+\n+    public Operation getOperation() {\n+        return operation;\n+    }\n+\n+    private Operation chooseOperation(String source) {\n+        if (Objects.equals(source, \"+\"))\n+            return new Add();\n+        if (Objects.equals(source, \"-\"))\n+            return new Deduct();\n+        if (Objects.equals(source, \"*\"))\n+            return new Multiply();\n+        if (Objects.equals(source, \"/\"))\n+            return new Divide();\n+\n+        return null;","path":"CommandLine/Parser.java","position":60,"original_position":60,"commit_id":"d0c3fbe50bd367ca6f918d15ca7dca978e8c78ae","original_commit_id":"d0c3fbe50bd367ca6f918d15ca7dca978e8c78ae","user":{"login":"AlexanderShushunov","id":5528356,"avatar_url":"https://avatars.githubusercontent.com/u/5528356?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexanderShushunov","html_url":"https://github.com/AlexanderShushunov","followers_url":"https://api.github.com/users/AlexanderShushunov/followers","following_url":"https://api.github.com/users/AlexanderShushunov/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderShushunov/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderShushunov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderShushunov/subscriptions","organizations_url":"https://api.github.com/users/AlexanderShushunov/orgs","repos_url":"https://api.github.com/users/AlexanderShushunov/repos","events_url":"https://api.github.com/users/AlexanderShushunov/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderShushunov/received_events","type":"User","site_admin":false},"body":"ух это не очень","created_at":"2015-12-01T19:28:41Z","updated_at":"2015-12-01T19:28:41Z","html_url":"https://github.com/dimandus/Epam_six_task/pull/1#discussion_r46325757","pull_request_url":"https://api.github.com/repos/dimandus/Epam_six_task/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/dimandus/Epam_six_task/pulls/comments/46325757"},"html":{"href":"https://github.com/dimandus/Epam_six_task/pull/1#discussion_r46325757"},"pull_request":{"href":"https://api.github.com/repos/dimandus/Epam_six_task/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/dimandus/Epam_six_task/pulls/1","id":51446448,"html_url":"https://github.com/dimandus/Epam_six_task/pull/1","diff_url":"https://github.com/dimandus/Epam_six_task/pull/1.diff","patch_url":"https://github.com/dimandus/Epam_six_task/pull/1.patch","issue_url":"https://api.github.com/repos/dimandus/Epam_six_task/issues/1","number":1,"state":"open","locked":false,"title":"Задание 6","user":{"login":"dimandus","id":15235058,"avatar_url":"https://avatars.githubusercontent.com/u/15235058?v=3","gravatar_id":"","url":"https://api.github.com/users/dimandus","html_url":"https://github.com/dimandus","followers_url":"https://api.github.com/users/dimandus/followers","following_url":"https://api.github.com/users/dimandus/following{/other_user}","gists_url":"https://api.github.com/users/dimandus/gists{/gist_id}","starred_url":"https://api.github.com/users/dimandus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimandus/subscriptions","organizations_url":"https://api.github.com/users/dimandus/orgs","repos_url":"https://api.github.com/users/dimandus/repos","events_url":"https://api.github.com/users/dimandus/events{/privacy}","received_events_url":"https://api.github.com/users/dimandus/received_events","type":"User","site_admin":false},"body":"Доброго времени суток, Александр!\r\nПрошу вас оценить это задание.","created_at":"2015-11-21T18:05:03Z","updated_at":"2015-12-01T19:28:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a48155566ccce3e0d38a2427bb934b1ae06690a7","assignee":{"login":"AlexanderShushunov","id":5528356,"avatar_url":"https://avatars.githubusercontent.com/u/5528356?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexanderShushunov","html_url":"https://github.com/AlexanderShushunov","followers_url":"https://api.github.com/users/AlexanderShushunov/followers","following_url":"https://api.github.com/users/AlexanderShushunov/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderShushunov/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderShushunov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderShushunov/subscriptions","organizations_url":"https://api.github.com/users/AlexanderShushunov/orgs","repos_url":"https://api.github.com/users/AlexanderShushunov/repos","events_url":"https://api.github.com/users/AlexanderShushunov/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderShushunov/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/dimandus/Epam_six_task/pulls/1/commits","review_comments_url":"https://api.github.com/repos/dimandus/Epam_six_task/pulls/1/comments","review_comment_url":"https://api.github.com/repos/dimandus/Epam_six_task/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dimandus/Epam_six_task/issues/1/comments","statuses_url":"https://api.github.com/repos/dimandus/Epam_six_task/statuses/d0c3fbe50bd367ca6f918d15ca7dca978e8c78ae","head":{"label":"dimandus:task","ref":"task","sha":"d0c3fbe50bd367ca6f918d15ca7dca978e8c78ae","user":{"login":"dimandus","id":15235058,"avatar_url":"https://avatars.githubusercontent.com/u/15235058?v=3","gravatar_id":"","url":"https://api.github.com/users/dimandus","html_url":"https://github.com/dimandus","followers_url":"https://api.github.com/users/dimandus/followers","following_url":"https://api.github.com/users/dimandus/following{/other_user}","gists_url":"https://api.github.com/users/dimandus/gists{/gist_id}","starred_url":"https://api.github.com/users/dimandus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimandus/subscriptions","organizations_url":"https://api.github.com/users/dimandus/orgs","repos_url":"https://api.github.com/users/dimandus/repos","events_url":"https://api.github.com/users/dimandus/events{/privacy}","received_events_url":"https://api.github.com/users/dimandus/received_events","type":"User","site_admin":false},"repo":{"id":46622611,"name":"Epam_six_task","full_name":"dimandus/Epam_six_task","owner":{"login":"dimandus","id":15235058,"avatar_url":"https://avatars.githubusercontent.com/u/15235058?v=3","gravatar_id":"","url":"https://api.github.com/users/dimandus","html_url":"https://github.com/dimandus","followers_url":"https://api.github.com/users/dimandus/followers","following_url":"https://api.github.com/users/dimandus/following{/other_user}","gists_url":"https://api.github.com/users/dimandus/gists{/gist_id}","starred_url":"https://api.github.com/users/dimandus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimandus/subscriptions","organizations_url":"https://api.github.com/users/dimandus/orgs","repos_url":"https://api.github.com/users/dimandus/repos","events_url":"https://api.github.com/users/dimandus/events{/privacy}","received_events_url":"https://api.github.com/users/dimandus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dimandus/Epam_six_task","description":"","fork":false,"url":"https://api.github.com/repos/dimandus/Epam_six_task","forks_url":"https://api.github.com/repos/dimandus/Epam_six_task/forks","keys_url":"https://api.github.com/repos/dimandus/Epam_six_task/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimandus/Epam_six_task/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimandus/Epam_six_task/teams","hooks_url":"https://api.github.com/repos/dimandus/Epam_six_task/hooks","issue_events_url":"https://api.github.com/repos/dimandus/Epam_six_task/issues/events{/number}","events_url":"https://api.github.com/repos/dimandus/Epam_six_task/events","assignees_url":"https://api.github.com/repos/dimandus/Epam_six_task/assignees{/user}","branches_url":"https://api.github.com/repos/dimandus/Epam_six_task/branches{/branch}","tags_url":"https://api.github.com/repos/dimandus/Epam_six_task/tags","blobs_url":"https://api.github.com/repos/dimandus/Epam_six_task/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimandus/Epam_six_task/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimandus/Epam_six_task/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimandus/Epam_six_task/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimandus/Epam_six_task/statuses/{sha}","languages_url":"https://api.github.com/repos/dimandus/Epam_six_task/languages","stargazers_url":"https://api.github.com/repos/dimandus/Epam_six_task/stargazers","contributors_url":"https://api.github.com/repos/dimandus/Epam_six_task/contributors","subscribers_url":"https://api.github.com/repos/dimandus/Epam_six_task/subscribers","subscription_url":"https://api.github.com/repos/dimandus/Epam_six_task/subscription","commits_url":"https://api.github.com/repos/dimandus/Epam_six_task/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimandus/Epam_six_task/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimandus/Epam_six_task/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimandus/Epam_six_task/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimandus/Epam_six_task/contents/{+path}","compare_url":"https://api.github.com/repos/dimandus/Epam_six_task/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimandus/Epam_six_task/merges","archive_url":"https://api.github.com/repos/dimandus/Epam_six_task/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimandus/Epam_six_task/downloads","issues_url":"https://api.github.com/repos/dimandus/Epam_six_task/issues{/number}","pulls_url":"https://api.github.com/repos/dimandus/Epam_six_task/pulls{/number}","milestones_url":"https://api.github.com/repos/dimandus/Epam_six_task/milestones{/number}","notifications_url":"https://api.github.com/repos/dimandus/Epam_six_task/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimandus/Epam_six_task/labels{/name}","releases_url":"https://api.github.com/repos/dimandus/Epam_six_task/releases{/id}","created_at":"2015-11-21T16:09:06Z","updated_at":"2015-11-21T16:09:06Z","pushed_at":"2015-11-21T18:05:03Z","git_url":"git://github.com/dimandus/Epam_six_task.git","ssh_url":"git@github.com:dimandus/Epam_six_task.git","clone_url":"https://github.com/dimandus/Epam_six_task.git","svn_url":"https://github.com/dimandus/Epam_six_task","homepage":null,"size":63,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"dimandus:master","ref":"master","sha":"49450040624c36e0fdccdf30d5027158266334c3","user":{"login":"dimandus","id":15235058,"avatar_url":"https://avatars.githubusercontent.com/u/15235058?v=3","gravatar_id":"","url":"https://api.github.com/users/dimandus","html_url":"https://github.com/dimandus","followers_url":"https://api.github.com/users/dimandus/followers","following_url":"https://api.github.com/users/dimandus/following{/other_user}","gists_url":"https://api.github.com/users/dimandus/gists{/gist_id}","starred_url":"https://api.github.com/users/dimandus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimandus/subscriptions","organizations_url":"https://api.github.com/users/dimandus/orgs","repos_url":"https://api.github.com/users/dimandus/repos","events_url":"https://api.github.com/users/dimandus/events{/privacy}","received_events_url":"https://api.github.com/users/dimandus/received_events","type":"User","site_admin":false},"repo":{"id":46622611,"name":"Epam_six_task","full_name":"dimandus/Epam_six_task","owner":{"login":"dimandus","id":15235058,"avatar_url":"https://avatars.githubusercontent.com/u/15235058?v=3","gravatar_id":"","url":"https://api.github.com/users/dimandus","html_url":"https://github.com/dimandus","followers_url":"https://api.github.com/users/dimandus/followers","following_url":"https://api.github.com/users/dimandus/following{/other_user}","gists_url":"https://api.github.com/users/dimandus/gists{/gist_id}","starred_url":"https://api.github.com/users/dimandus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimandus/subscriptions","organizations_url":"https://api.github.com/users/dimandus/orgs","repos_url":"https://api.github.com/users/dimandus/repos","events_url":"https://api.github.com/users/dimandus/events{/privacy}","received_events_url":"https://api.github.com/users/dimandus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dimandus/Epam_six_task","description":"","fork":false,"url":"https://api.github.com/repos/dimandus/Epam_six_task","forks_url":"https://api.github.com/repos/dimandus/Epam_six_task/forks","keys_url":"https://api.github.com/repos/dimandus/Epam_six_task/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimandus/Epam_six_task/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimandus/Epam_six_task/teams","hooks_url":"https://api.github.com/repos/dimandus/Epam_six_task/hooks","issue_events_url":"https://api.github.com/repos/dimandus/Epam_six_task/issues/events{/number}","events_url":"https://api.github.com/repos/dimandus/Epam_six_task/events","assignees_url":"https://api.github.com/repos/dimandus/Epam_six_task/assignees{/user}","branches_url":"https://api.github.com/repos/dimandus/Epam_six_task/branches{/branch}","tags_url":"https://api.github.com/repos/dimandus/Epam_six_task/tags","blobs_url":"https://api.github.com/repos/dimandus/Epam_six_task/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimandus/Epam_six_task/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimandus/Epam_six_task/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimandus/Epam_six_task/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimandus/Epam_six_task/statuses/{sha}","languages_url":"https://api.github.com/repos/dimandus/Epam_six_task/languages","stargazers_url":"https://api.github.com/repos/dimandus/Epam_six_task/stargazers","contributors_url":"https://api.github.com/repos/dimandus/Epam_six_task/contributors","subscribers_url":"https://api.github.com/repos/dimandus/Epam_six_task/subscribers","subscription_url":"https://api.github.com/repos/dimandus/Epam_six_task/subscription","commits_url":"https://api.github.com/repos/dimandus/Epam_six_task/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimandus/Epam_six_task/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimandus/Epam_six_task/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimandus/Epam_six_task/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimandus/Epam_six_task/contents/{+path}","compare_url":"https://api.github.com/repos/dimandus/Epam_six_task/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimandus/Epam_six_task/merges","archive_url":"https://api.github.com/repos/dimandus/Epam_six_task/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimandus/Epam_six_task/downloads","issues_url":"https://api.github.com/repos/dimandus/Epam_six_task/issues{/number}","pulls_url":"https://api.github.com/repos/dimandus/Epam_six_task/pulls{/number}","milestones_url":"https://api.github.com/repos/dimandus/Epam_six_task/milestones{/number}","notifications_url":"https://api.github.com/repos/dimandus/Epam_six_task/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimandus/Epam_six_task/labels{/name}","releases_url":"https://api.github.com/repos/dimandus/Epam_six_task/releases{/id}","created_at":"2015-11-21T16:09:06Z","updated_at":"2015-11-21T16:09:06Z","pushed_at":"2015-11-21T18:05:03Z","git_url":"git://github.com/dimandus/Epam_six_task.git","ssh_url":"git@github.com:dimandus/Epam_six_task.git","clone_url":"https://github.com/dimandus/Epam_six_task.git","svn_url":"https://github.com/dimandus/Epam_six_task","homepage":null,"size":63,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dimandus/Epam_six_task/pulls/1"},"html":{"href":"https://github.com/dimandus/Epam_six_task/pull/1"},"issue":{"href":"https://api.github.com/repos/dimandus/Epam_six_task/issues/1"},"comments":{"href":"https://api.github.com/repos/dimandus/Epam_six_task/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/dimandus/Epam_six_task/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/dimandus/Epam_six_task/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dimandus/Epam_six_task/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/dimandus/Epam_six_task/statuses/d0c3fbe50bd367ca6f918d15ca7dca978e8c78ae"}}}}