{"action":"created","comment":{"url":"https://api.github.com/repos/VovkGeorgy/nov/pulls/comments/239723169","pull_request_review_id":182585270,"id":239723169,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzOTcyMzE2OQ==","diff_hunk":"@@ -0,0 +1,84 @@\n+package main.java.by.home.nov2.service.impl;\n+\n+import main.java.by.home.nov2.entity.MainMenu;\n+import main.java.by.home.nov2.entity.impl.Text;\n+import main.java.by.home.nov2.utils.ConsoleUtils;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+\n+/**\n+ * Class process users requests from console and call needed methods\n+ */\n+public class ConsoleHandler {\n+    private static final int INPUT_TEXT = 1;\n+    private static final int READ_FILE = 2;\n+    private static final int EXIT_M1 = 3;\n+    private static final int CONTINUE_TEXT_INPUT = 1;\n+    private static final int WRITE_FILE = 2;\n+    private static final int WRITE_IN_CONSOLE = 3;\n+    private static final int ADD_CATS = 4;\n+    private static final int EXIT_M2 = 5;\n+    private static ConsoleHandler consoleHandlerInstance;\n+    private static Text textInstance = Text.getInstance();\n+    private static final Logger LOGGER = LoggerFactory.getLogger(ConsoleHandler.class);\n+\n+    public static ConsoleHandler getInstance() {\n+        if (consoleHandlerInstance == null) consoleHandlerInstance = new ConsoleHandler();\n+        return consoleHandlerInstance;\n+    }\n+\n+\n+    /**\n+     * Method process first request from user\n+     */\n+    public void processFirstRequest() {\n+        LOGGER.debug(\"Getting first response\");\n+        System.out.println(MainMenu.getMainMenu());\n+        switch (ConsoleUtils.getIntFromConsole(consoleHandlerInstance::processFirstRequest)) {\n+            case INPUT_TEXT:\n+                textInstance.addText();\n+                break;\n+            case READ_FILE:\n+                textInstance.readFromFile();\n+                break;\n+            case EXIT_M1:\n+                System.exit(111);\n+                break;\n+            default:\n+                System.out.println(\"Wrong input\");\n+                processFirstRequest();\n+        }\n+        processSecondRequest();","path":"src/main/java/by/home/nov2/service/impl/ConsoleHandler.java","position":null,"original_position":52,"commit_id":"c93004d800b00c75820a3e7b5648d7aa7e8fd84f","original_commit_id":"c93004d800b00c75820a3e7b5648d7aa7e8fd84f","user":{"login":"VovkGeorgy","id":30996856,"node_id":"MDQ6VXNlcjMwOTk2ODU2","avatar_url":"https://avatars2.githubusercontent.com/u/30996856?v=4","gravatar_id":"","url":"https://api.github.com/users/VovkGeorgy","html_url":"https://github.com/VovkGeorgy","followers_url":"https://api.github.com/users/VovkGeorgy/followers","following_url":"https://api.github.com/users/VovkGeorgy/following{/other_user}","gists_url":"https://api.github.com/users/VovkGeorgy/gists{/gist_id}","starred_url":"https://api.github.com/users/VovkGeorgy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VovkGeorgy/subscriptions","organizations_url":"https://api.github.com/users/VovkGeorgy/orgs","repos_url":"https://api.github.com/users/VovkGeorgy/repos","events_url":"https://api.github.com/users/VovkGeorgy/events{/privacy}","received_events_url":"https://api.github.com/users/VovkGeorgy/received_events","type":"User","site_admin":false},"body":"Тут она вызывает вторую менюху, когда команда из первой отработала\r\nА вторая менюха вызывается заново после отработки её команд.","created_at":"2018-12-07T08:09:31Z","updated_at":"2018-12-07T08:09:31Z","html_url":"https://github.com/VovkGeorgy/nov/pull/1#discussion_r239723169","pull_request_url":"https://api.github.com/repos/VovkGeorgy/nov/pulls/1","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/VovkGeorgy/nov/pulls/comments/239723169"},"html":{"href":"https://github.com/VovkGeorgy/nov/pull/1#discussion_r239723169"},"pull_request":{"href":"https://api.github.com/repos/VovkGeorgy/nov/pulls/1"}},"in_reply_to_id":239630322},"pull_request":{"url":"https://api.github.com/repos/VovkGeorgy/nov/pulls/1","id":236398241,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM2Mzk4MjQx","html_url":"https://github.com/VovkGeorgy/nov/pull/1","diff_url":"https://github.com/VovkGeorgy/nov/pull/1.diff","patch_url":"https://github.com/VovkGeorgy/nov/pull/1.patch","issue_url":"https://api.github.com/repos/VovkGeorgy/nov/issues/1","number":1,"state":"open","locked":false,"title":"Test_PR","user":{"login":"VovkGeorgy","id":30996856,"node_id":"MDQ6VXNlcjMwOTk2ODU2","avatar_url":"https://avatars2.githubusercontent.com/u/30996856?v=4","gravatar_id":"","url":"https://api.github.com/users/VovkGeorgy","html_url":"https://github.com/VovkGeorgy","followers_url":"https://api.github.com/users/VovkGeorgy/followers","following_url":"https://api.github.com/users/VovkGeorgy/following{/other_user}","gists_url":"https://api.github.com/users/VovkGeorgy/gists{/gist_id}","starred_url":"https://api.github.com/users/VovkGeorgy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VovkGeorgy/subscriptions","organizations_url":"https://api.github.com/users/VovkGeorgy/orgs","repos_url":"https://api.github.com/users/VovkGeorgy/repos","events_url":"https://api.github.com/users/VovkGeorgy/events{/privacy}","received_events_url":"https://api.github.com/users/VovkGeorgy/received_events","type":"User","site_admin":false},"body":"Yes, i wrote this pice of shit.","created_at":"2018-12-06T03:40:51Z","updated_at":"2018-12-07T08:09:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"62a8c606ce2005a3d0885c560dc5fcb496221b4b","assignee":{"login":"VovkGeorgy","id":30996856,"node_id":"MDQ6VXNlcjMwOTk2ODU2","avatar_url":"https://avatars2.githubusercontent.com/u/30996856?v=4","gravatar_id":"","url":"https://api.github.com/users/VovkGeorgy","html_url":"https://github.com/VovkGeorgy","followers_url":"https://api.github.com/users/VovkGeorgy/followers","following_url":"https://api.github.com/users/VovkGeorgy/following{/other_user}","gists_url":"https://api.github.com/users/VovkGeorgy/gists{/gist_id}","starred_url":"https://api.github.com/users/VovkGeorgy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VovkGeorgy/subscriptions","organizations_url":"https://api.github.com/users/VovkGeorgy/orgs","repos_url":"https://api.github.com/users/VovkGeorgy/repos","events_url":"https://api.github.com/users/VovkGeorgy/events{/privacy}","received_events_url":"https://api.github.com/users/VovkGeorgy/received_events","type":"User","site_admin":false},"assignees":[{"login":"VovkGeorgy","id":30996856,"node_id":"MDQ6VXNlcjMwOTk2ODU2","avatar_url":"https://avatars2.githubusercontent.com/u/30996856?v=4","gravatar_id":"","url":"https://api.github.com/users/VovkGeorgy","html_url":"https://github.com/VovkGeorgy","followers_url":"https://api.github.com/users/VovkGeorgy/followers","following_url":"https://api.github.com/users/VovkGeorgy/following{/other_user}","gists_url":"https://api.github.com/users/VovkGeorgy/gists{/gist_id}","starred_url":"https://api.github.com/users/VovkGeorgy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VovkGeorgy/subscriptions","organizations_url":"https://api.github.com/users/VovkGeorgy/orgs","repos_url":"https://api.github.com/users/VovkGeorgy/repos","events_url":"https://api.github.com/users/VovkGeorgy/events{/privacy}","received_events_url":"https://api.github.com/users/VovkGeorgy/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/VovkGeorgy/nov/pulls/1/commits","review_comments_url":"https://api.github.com/repos/VovkGeorgy/nov/pulls/1/comments","review_comment_url":"https://api.github.com/repos/VovkGeorgy/nov/pulls/comments{/number}","comments_url":"https://api.github.com/repos/VovkGeorgy/nov/issues/1/comments","statuses_url":"https://api.github.com/repos/VovkGeorgy/nov/statuses/c93004d800b00c75820a3e7b5648d7aa7e8fd84f","head":{"label":"VovkGeorgy:develop","ref":"develop","sha":"c93004d800b00c75820a3e7b5648d7aa7e8fd84f","user":{"login":"VovkGeorgy","id":30996856,"node_id":"MDQ6VXNlcjMwOTk2ODU2","avatar_url":"https://avatars2.githubusercontent.com/u/30996856?v=4","gravatar_id":"","url":"https://api.github.com/users/VovkGeorgy","html_url":"https://github.com/VovkGeorgy","followers_url":"https://api.github.com/users/VovkGeorgy/followers","following_url":"https://api.github.com/users/VovkGeorgy/following{/other_user}","gists_url":"https://api.github.com/users/VovkGeorgy/gists{/gist_id}","starred_url":"https://api.github.com/users/VovkGeorgy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VovkGeorgy/subscriptions","organizations_url":"https://api.github.com/users/VovkGeorgy/orgs","repos_url":"https://api.github.com/users/VovkGeorgy/repos","events_url":"https://api.github.com/users/VovkGeorgy/events{/privacy}","received_events_url":"https://api.github.com/users/VovkGeorgy/received_events","type":"User","site_admin":false},"repo":{"id":160191758,"node_id":"MDEwOlJlcG9zaXRvcnkxNjAxOTE3NTg=","name":"nov","full_name":"VovkGeorgy/nov","private":false,"owner":{"login":"VovkGeorgy","id":30996856,"node_id":"MDQ6VXNlcjMwOTk2ODU2","avatar_url":"https://avatars2.githubusercontent.com/u/30996856?v=4","gravatar_id":"","url":"https://api.github.com/users/VovkGeorgy","html_url":"https://github.com/VovkGeorgy","followers_url":"https://api.github.com/users/VovkGeorgy/followers","following_url":"https://api.github.com/users/VovkGeorgy/following{/other_user}","gists_url":"https://api.github.com/users/VovkGeorgy/gists{/gist_id}","starred_url":"https://api.github.com/users/VovkGeorgy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VovkGeorgy/subscriptions","organizations_url":"https://api.github.com/users/VovkGeorgy/orgs","repos_url":"https://api.github.com/users/VovkGeorgy/repos","events_url":"https://api.github.com/users/VovkGeorgy/events{/privacy}","received_events_url":"https://api.github.com/users/VovkGeorgy/received_events","type":"User","site_admin":false},"html_url":"https://github.com/VovkGeorgy/nov","description":null,"fork":false,"url":"https://api.github.com/repos/VovkGeorgy/nov","forks_url":"https://api.github.com/repos/VovkGeorgy/nov/forks","keys_url":"https://api.github.com/repos/VovkGeorgy/nov/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VovkGeorgy/nov/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VovkGeorgy/nov/teams","hooks_url":"https://api.github.com/repos/VovkGeorgy/nov/hooks","issue_events_url":"https://api.github.com/repos/VovkGeorgy/nov/issues/events{/number}","events_url":"https://api.github.com/repos/VovkGeorgy/nov/events","assignees_url":"https://api.github.com/repos/VovkGeorgy/nov/assignees{/user}","branches_url":"https://api.github.com/repos/VovkGeorgy/nov/branches{/branch}","tags_url":"https://api.github.com/repos/VovkGeorgy/nov/tags","blobs_url":"https://api.github.com/repos/VovkGeorgy/nov/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VovkGeorgy/nov/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VovkGeorgy/nov/git/refs{/sha}","trees_url":"https://api.github.com/repos/VovkGeorgy/nov/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VovkGeorgy/nov/statuses/{sha}","languages_url":"https://api.github.com/repos/VovkGeorgy/nov/languages","stargazers_url":"https://api.github.com/repos/VovkGeorgy/nov/stargazers","contributors_url":"https://api.github.com/repos/VovkGeorgy/nov/contributors","subscribers_url":"https://api.github.com/repos/VovkGeorgy/nov/subscribers","subscription_url":"https://api.github.com/repos/VovkGeorgy/nov/subscription","commits_url":"https://api.github.com/repos/VovkGeorgy/nov/commits{/sha}","git_commits_url":"https://api.github.com/repos/VovkGeorgy/nov/git/commits{/sha}","comments_url":"https://api.github.com/repos/VovkGeorgy/nov/comments{/number}","issue_comment_url":"https://api.github.com/repos/VovkGeorgy/nov/issues/comments{/number}","contents_url":"https://api.github.com/repos/VovkGeorgy/nov/contents/{+path}","compare_url":"https://api.github.com/repos/VovkGeorgy/nov/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VovkGeorgy/nov/merges","archive_url":"https://api.github.com/repos/VovkGeorgy/nov/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VovkGeorgy/nov/downloads","issues_url":"https://api.github.com/repos/VovkGeorgy/nov/issues{/number}","pulls_url":"https://api.github.com/repos/VovkGeorgy/nov/pulls{/number}","milestones_url":"https://api.github.com/repos/VovkGeorgy/nov/milestones{/number}","notifications_url":"https://api.github.com/repos/VovkGeorgy/nov/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VovkGeorgy/nov/labels{/name}","releases_url":"https://api.github.com/repos/VovkGeorgy/nov/releases{/id}","deployments_url":"https://api.github.com/repos/VovkGeorgy/nov/deployments","created_at":"2018-12-03T13:02:32Z","updated_at":"2018-12-06T10:47:20Z","pushed_at":"2018-12-06T10:47:19Z","git_url":"git://github.com/VovkGeorgy/nov.git","ssh_url":"git@github.com:VovkGeorgy/nov.git","clone_url":"https://github.com/VovkGeorgy/nov.git","svn_url":"https://github.com/VovkGeorgy/nov","homepage":null,"size":12,"stargazers_count":0,"watchers_count":0,"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":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"VovkGeorgy:master","ref":"master","sha":"06ae20bdb2deed012eb1623774e3a2ffb7483552","user":{"login":"VovkGeorgy","id":30996856,"node_id":"MDQ6VXNlcjMwOTk2ODU2","avatar_url":"https://avatars2.githubusercontent.com/u/30996856?v=4","gravatar_id":"","url":"https://api.github.com/users/VovkGeorgy","html_url":"https://github.com/VovkGeorgy","followers_url":"https://api.github.com/users/VovkGeorgy/followers","following_url":"https://api.github.com/users/VovkGeorgy/following{/other_user}","gists_url":"https://api.github.com/users/VovkGeorgy/gists{/gist_id}","starred_url":"https://api.github.com/users/VovkGeorgy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VovkGeorgy/subscriptions","organizations_url":"https://api.github.com/users/VovkGeorgy/orgs","repos_url":"https://api.github.com/users/VovkGeorgy/repos","events_url":"https://api.github.com/users/VovkGeorgy/events{/privacy}","received_events_url":"https://api.github.com/users/VovkGeorgy/received_events","type":"User","site_admin":false},"repo":{"id":160191758,"node_id":"MDEwOlJlcG9zaXRvcnkxNjAxOTE3NTg=","name":"nov","full_name":"VovkGeorgy/nov","private":false,"owner":{"login":"VovkGeorgy","id":30996856,"node_id":"MDQ6VXNlcjMwOTk2ODU2","avatar_url":"https://avatars2.githubusercontent.com/u/30996856?v=4","gravatar_id":"","url":"https://api.github.com/users/VovkGeorgy","html_url":"https://github.com/VovkGeorgy","followers_url":"https://api.github.com/users/VovkGeorgy/followers","following_url":"https://api.github.com/users/VovkGeorgy/following{/other_user}","gists_url":"https://api.github.com/users/VovkGeorgy/gists{/gist_id}","starred_url":"https://api.github.com/users/VovkGeorgy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VovkGeorgy/subscriptions","organizations_url":"https://api.github.com/users/VovkGeorgy/orgs","repos_url":"https://api.github.com/users/VovkGeorgy/repos","events_url":"https://api.github.com/users/VovkGeorgy/events{/privacy}","received_events_url":"https://api.github.com/users/VovkGeorgy/received_events","type":"User","site_admin":false},"html_url":"https://github.com/VovkGeorgy/nov","description":null,"fork":false,"url":"https://api.github.com/repos/VovkGeorgy/nov","forks_url":"https://api.github.com/repos/VovkGeorgy/nov/forks","keys_url":"https://api.github.com/repos/VovkGeorgy/nov/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VovkGeorgy/nov/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VovkGeorgy/nov/teams","hooks_url":"https://api.github.com/repos/VovkGeorgy/nov/hooks","issue_events_url":"https://api.github.com/repos/VovkGeorgy/nov/issues/events{/number}","events_url":"https://api.github.com/repos/VovkGeorgy/nov/events","assignees_url":"https://api.github.com/repos/VovkGeorgy/nov/assignees{/user}","branches_url":"https://api.github.com/repos/VovkGeorgy/nov/branches{/branch}","tags_url":"https://api.github.com/repos/VovkGeorgy/nov/tags","blobs_url":"https://api.github.com/repos/VovkGeorgy/nov/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VovkGeorgy/nov/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VovkGeorgy/nov/git/refs{/sha}","trees_url":"https://api.github.com/repos/VovkGeorgy/nov/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VovkGeorgy/nov/statuses/{sha}","languages_url":"https://api.github.com/repos/VovkGeorgy/nov/languages","stargazers_url":"https://api.github.com/repos/VovkGeorgy/nov/stargazers","contributors_url":"https://api.github.com/repos/VovkGeorgy/nov/contributors","subscribers_url":"https://api.github.com/repos/VovkGeorgy/nov/subscribers","subscription_url":"https://api.github.com/repos/VovkGeorgy/nov/subscription","commits_url":"https://api.github.com/repos/VovkGeorgy/nov/commits{/sha}","git_commits_url":"https://api.github.com/repos/VovkGeorgy/nov/git/commits{/sha}","comments_url":"https://api.github.com/repos/VovkGeorgy/nov/comments{/number}","issue_comment_url":"https://api.github.com/repos/VovkGeorgy/nov/issues/comments{/number}","contents_url":"https://api.github.com/repos/VovkGeorgy/nov/contents/{+path}","compare_url":"https://api.github.com/repos/VovkGeorgy/nov/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VovkGeorgy/nov/merges","archive_url":"https://api.github.com/repos/VovkGeorgy/nov/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VovkGeorgy/nov/downloads","issues_url":"https://api.github.com/repos/VovkGeorgy/nov/issues{/number}","pulls_url":"https://api.github.com/repos/VovkGeorgy/nov/pulls{/number}","milestones_url":"https://api.github.com/repos/VovkGeorgy/nov/milestones{/number}","notifications_url":"https://api.github.com/repos/VovkGeorgy/nov/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VovkGeorgy/nov/labels{/name}","releases_url":"https://api.github.com/repos/VovkGeorgy/nov/releases{/id}","deployments_url":"https://api.github.com/repos/VovkGeorgy/nov/deployments","created_at":"2018-12-03T13:02:32Z","updated_at":"2018-12-06T10:47:20Z","pushed_at":"2018-12-06T10:47:19Z","git_url":"git://github.com/VovkGeorgy/nov.git","ssh_url":"git@github.com:VovkGeorgy/nov.git","clone_url":"https://github.com/VovkGeorgy/nov.git","svn_url":"https://github.com/VovkGeorgy/nov","homepage":null,"size":12,"stargazers_count":0,"watchers_count":0,"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":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/VovkGeorgy/nov/pulls/1"},"html":{"href":"https://github.com/VovkGeorgy/nov/pull/1"},"issue":{"href":"https://api.github.com/repos/VovkGeorgy/nov/issues/1"},"comments":{"href":"https://api.github.com/repos/VovkGeorgy/nov/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/VovkGeorgy/nov/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/VovkGeorgy/nov/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/VovkGeorgy/nov/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/VovkGeorgy/nov/statuses/c93004d800b00c75820a3e7b5648d7aa7e8fd84f"}},"author_association":"OWNER"}}
{"actor":{"display_login":"VovkGeorgy"}}