{"action":"created","comment":{"url":"https://api.github.com/repos/quitefire/automationcourse/pulls/comments/118913192","pull_request_review_id":40749011,"id":118913192,"diff_hunk":"@@ -0,0 +1,104 @@\n+package com.courses.homeworkTask1;\n+\n+import java.util.ArrayList;\n+\n+class ContactList {\n+    public int contactList;\n+    public ArrayList < Contact > contacts;\n+\n+    public ContactList(int contactList) {\n+        this.contactList = contactList;\n+        this.contacts = new ArrayList < Contact > ();\n+    }\n+\n+    public Boolean addContact(Contact contact) {\n+            contacts.add(contact);\n+        return true;\n+    }\n+\n+    public ArrayList < Contact > getContacts() {\n+        return contacts;\n+    }\n+\n+    public void updateContact(Contact oldContact, Contact newContact) {\n+            contacts.set(findPosition(oldContact), newContact);\n+    }\n+\n+    public void removeContact(Contact contact) {\n+            contacts.remove(findPosition(contact));\n+    }\n+\n+    public void removeLastContact(Contact contact) {\n+            contacts.remove(findLastPosition(contact));\n+    }\n+\n+    /**\n+     *\n+     * @param number\n+     * @return\n+     */\n+    public Boolean isValidPhone(String number) {\n+        if (!(number.contains(\"0\") || number.contains(\"1\") | number.contains(\"2\") | number.contains(\"3\") | number.contains(\"4\") | number.contains(\"5\") | number.contains(\"6\") | number.contains(\"7\") | number.contains(\"8\") | number.contains(\"9\")) || number.length() != 10) {\n+            System.out.println(\"Contact is not added!\\n\" +\n+                    \"Phone number should contain 10 numbers. Try again..\");\n+            return false;\n+        } else return true;\n+    }\n+","path":"OlgaKolesnichenko/src/main/java/com/courses/homeworkTask1/ContactList.java","position":47,"original_position":47,"commit_id":"c65e74c7d27f887252098ad50ed102cc0db80701","original_commit_id":"77ef857e3ce0285c6a2e7b62327a7b0f3e4e60c9","user":{"login":"quitefire","id":15284195,"avatar_url":"https://avatars1.githubusercontent.com/u/15284195?v=3","gravatar_id":"","url":"https://api.github.com/users/quitefire","html_url":"https://github.com/quitefire","followers_url":"https://api.github.com/users/quitefire/followers","following_url":"https://api.github.com/users/quitefire/following{/other_user}","gists_url":"https://api.github.com/users/quitefire/gists{/gist_id}","starred_url":"https://api.github.com/users/quitefire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quitefire/subscriptions","organizations_url":"https://api.github.com/users/quitefire/orgs","repos_url":"https://api.github.com/users/quitefire/repos","events_url":"https://api.github.com/users/quitefire/events{/privacy}","received_events_url":"https://api.github.com/users/quitefire/received_events","type":"User","site_admin":false},"body":"1) use regexp to check a phone number format and length \r\n2) isValidPhone() can be moved to a separate validator class or moved to Contact class where it checks phone number at the moment of contact construction \r\nas an option: \r\nhttps://github.com/quitefire/automationcourse/blob/645559eb2cc970bbc8c491bd293748df99643f42/SergeyPitel/src/main/java/com/courses/contactlist/utils/PhoneNumberValidator.java","created_at":"2017-05-29T10:52:39Z","updated_at":"2017-05-29T10:52:39Z","html_url":"https://github.com/quitefire/automationcourse/pull/5#discussion_r118913192","pull_request_url":"https://api.github.com/repos/quitefire/automationcourse/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/quitefire/automationcourse/pulls/comments/118913192"},"html":{"href":"https://github.com/quitefire/automationcourse/pull/5#discussion_r118913192"},"pull_request":{"href":"https://api.github.com/repos/quitefire/automationcourse/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/quitefire/automationcourse/pulls/5","id":122796576,"html_url":"https://github.com/quitefire/automationcourse/pull/5","diff_url":"https://github.com/quitefire/automationcourse/pull/5.diff","patch_url":"https://github.com/quitefire/automationcourse/pull/5.patch","issue_url":"https://api.github.com/repos/quitefire/automationcourse/issues/5","number":5,"state":"open","locked":false,"title":"homework 1: OOP Entry Test + Task1 Contact app","user":{"login":"OLGAkolesnichenko","id":13717306,"avatar_url":"https://avatars3.githubusercontent.com/u/13717306?v=3","gravatar_id":"","url":"https://api.github.com/users/OLGAkolesnichenko","html_url":"https://github.com/OLGAkolesnichenko","followers_url":"https://api.github.com/users/OLGAkolesnichenko/followers","following_url":"https://api.github.com/users/OLGAkolesnichenko/following{/other_user}","gists_url":"https://api.github.com/users/OLGAkolesnichenko/gists{/gist_id}","starred_url":"https://api.github.com/users/OLGAkolesnichenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OLGAkolesnichenko/subscriptions","organizations_url":"https://api.github.com/users/OLGAkolesnichenko/orgs","repos_url":"https://api.github.com/users/OLGAkolesnichenko/repos","events_url":"https://api.github.com/users/OLGAkolesnichenko/events{/privacy}","received_events_url":"https://api.github.com/users/OLGAkolesnichenko/received_events","type":"User","site_admin":false},"body":"@quitefire please check","created_at":"2017-05-28T14:04:00Z","updated_at":"2017-05-29T10:52:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2dea85343d77d641943fa2e5b516b3b8daea8b3f","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/quitefire/automationcourse/pulls/5/commits","review_comments_url":"https://api.github.com/repos/quitefire/automationcourse/pulls/5/comments","review_comment_url":"https://api.github.com/repos/quitefire/automationcourse/pulls/comments{/number}","comments_url":"https://api.github.com/repos/quitefire/automationcourse/issues/5/comments","statuses_url":"https://api.github.com/repos/quitefire/automationcourse/statuses/c65e74c7d27f887252098ad50ed102cc0db80701","head":{"label":"quitefire:olga_kolesnichenko_homework_1","ref":"olga_kolesnichenko_homework_1","sha":"c65e74c7d27f887252098ad50ed102cc0db80701","user":{"login":"quitefire","id":15284195,"avatar_url":"https://avatars1.githubusercontent.com/u/15284195?v=3","gravatar_id":"","url":"https://api.github.com/users/quitefire","html_url":"https://github.com/quitefire","followers_url":"https://api.github.com/users/quitefire/followers","following_url":"https://api.github.com/users/quitefire/following{/other_user}","gists_url":"https://api.github.com/users/quitefire/gists{/gist_id}","starred_url":"https://api.github.com/users/quitefire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quitefire/subscriptions","organizations_url":"https://api.github.com/users/quitefire/orgs","repos_url":"https://api.github.com/users/quitefire/repos","events_url":"https://api.github.com/users/quitefire/events{/privacy}","received_events_url":"https://api.github.com/users/quitefire/received_events","type":"User","site_admin":false},"repo":{"id":92502979,"name":"automationcourse","full_name":"quitefire/automationcourse","owner":{"login":"quitefire","id":15284195,"avatar_url":"https://avatars1.githubusercontent.com/u/15284195?v=3","gravatar_id":"","url":"https://api.github.com/users/quitefire","html_url":"https://github.com/quitefire","followers_url":"https://api.github.com/users/quitefire/followers","following_url":"https://api.github.com/users/quitefire/following{/other_user}","gists_url":"https://api.github.com/users/quitefire/gists{/gist_id}","starred_url":"https://api.github.com/users/quitefire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quitefire/subscriptions","organizations_url":"https://api.github.com/users/quitefire/orgs","repos_url":"https://api.github.com/users/quitefire/repos","events_url":"https://api.github.com/users/quitefire/events{/privacy}","received_events_url":"https://api.github.com/users/quitefire/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/quitefire/automationcourse","description":null,"fork":false,"url":"https://api.github.com/repos/quitefire/automationcourse","forks_url":"https://api.github.com/repos/quitefire/automationcourse/forks","keys_url":"https://api.github.com/repos/quitefire/automationcourse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/quitefire/automationcourse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/quitefire/automationcourse/teams","hooks_url":"https://api.github.com/repos/quitefire/automationcourse/hooks","issue_events_url":"https://api.github.com/repos/quitefire/automationcourse/issues/events{/number}","events_url":"https://api.github.com/repos/quitefire/automationcourse/events","assignees_url":"https://api.github.com/repos/quitefire/automationcourse/assignees{/user}","branches_url":"https://api.github.com/repos/quitefire/automationcourse/branches{/branch}","tags_url":"https://api.github.com/repos/quitefire/automationcourse/tags","blobs_url":"https://api.github.com/repos/quitefire/automationcourse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/quitefire/automationcourse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/quitefire/automationcourse/git/refs{/sha}","trees_url":"https://api.github.com/repos/quitefire/automationcourse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/quitefire/automationcourse/statuses/{sha}","languages_url":"https://api.github.com/repos/quitefire/automationcourse/languages","stargazers_url":"https://api.github.com/repos/quitefire/automationcourse/stargazers","contributors_url":"https://api.github.com/repos/quitefire/automationcourse/contributors","subscribers_url":"https://api.github.com/repos/quitefire/automationcourse/subscribers","subscription_url":"https://api.github.com/repos/quitefire/automationcourse/subscription","commits_url":"https://api.github.com/repos/quitefire/automationcourse/commits{/sha}","git_commits_url":"https://api.github.com/repos/quitefire/automationcourse/git/commits{/sha}","comments_url":"https://api.github.com/repos/quitefire/automationcourse/comments{/number}","issue_comment_url":"https://api.github.com/repos/quitefire/automationcourse/issues/comments{/number}","contents_url":"https://api.github.com/repos/quitefire/automationcourse/contents/{+path}","compare_url":"https://api.github.com/repos/quitefire/automationcourse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/quitefire/automationcourse/merges","archive_url":"https://api.github.com/repos/quitefire/automationcourse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/quitefire/automationcourse/downloads","issues_url":"https://api.github.com/repos/quitefire/automationcourse/issues{/number}","pulls_url":"https://api.github.com/repos/quitefire/automationcourse/pulls{/number}","milestones_url":"https://api.github.com/repos/quitefire/automationcourse/milestones{/number}","notifications_url":"https://api.github.com/repos/quitefire/automationcourse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/quitefire/automationcourse/labels{/name}","releases_url":"https://api.github.com/repos/quitefire/automationcourse/releases{/id}","deployments_url":"https://api.github.com/repos/quitefire/automationcourse/deployments","created_at":"2017-05-26T11:09:41Z","updated_at":"2017-05-26T11:10:12Z","pushed_at":"2017-05-28T22:54:44Z","git_url":"git://github.com/quitefire/automationcourse.git","ssh_url":"git@github.com:quitefire/automationcourse.git","clone_url":"https://github.com/quitefire/automationcourse.git","svn_url":"https://github.com/quitefire/automationcourse","homepage":null,"size":50,"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":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"quitefire:master","ref":"master","sha":"d893bb9e017488949a168b80d96b2351d35182b8","user":{"login":"quitefire","id":15284195,"avatar_url":"https://avatars1.githubusercontent.com/u/15284195?v=3","gravatar_id":"","url":"https://api.github.com/users/quitefire","html_url":"https://github.com/quitefire","followers_url":"https://api.github.com/users/quitefire/followers","following_url":"https://api.github.com/users/quitefire/following{/other_user}","gists_url":"https://api.github.com/users/quitefire/gists{/gist_id}","starred_url":"https://api.github.com/users/quitefire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quitefire/subscriptions","organizations_url":"https://api.github.com/users/quitefire/orgs","repos_url":"https://api.github.com/users/quitefire/repos","events_url":"https://api.github.com/users/quitefire/events{/privacy}","received_events_url":"https://api.github.com/users/quitefire/received_events","type":"User","site_admin":false},"repo":{"id":92502979,"name":"automationcourse","full_name":"quitefire/automationcourse","owner":{"login":"quitefire","id":15284195,"avatar_url":"https://avatars1.githubusercontent.com/u/15284195?v=3","gravatar_id":"","url":"https://api.github.com/users/quitefire","html_url":"https://github.com/quitefire","followers_url":"https://api.github.com/users/quitefire/followers","following_url":"https://api.github.com/users/quitefire/following{/other_user}","gists_url":"https://api.github.com/users/quitefire/gists{/gist_id}","starred_url":"https://api.github.com/users/quitefire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quitefire/subscriptions","organizations_url":"https://api.github.com/users/quitefire/orgs","repos_url":"https://api.github.com/users/quitefire/repos","events_url":"https://api.github.com/users/quitefire/events{/privacy}","received_events_url":"https://api.github.com/users/quitefire/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/quitefire/automationcourse","description":null,"fork":false,"url":"https://api.github.com/repos/quitefire/automationcourse","forks_url":"https://api.github.com/repos/quitefire/automationcourse/forks","keys_url":"https://api.github.com/repos/quitefire/automationcourse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/quitefire/automationcourse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/quitefire/automationcourse/teams","hooks_url":"https://api.github.com/repos/quitefire/automationcourse/hooks","issue_events_url":"https://api.github.com/repos/quitefire/automationcourse/issues/events{/number}","events_url":"https://api.github.com/repos/quitefire/automationcourse/events","assignees_url":"https://api.github.com/repos/quitefire/automationcourse/assignees{/user}","branches_url":"https://api.github.com/repos/quitefire/automationcourse/branches{/branch}","tags_url":"https://api.github.com/repos/quitefire/automationcourse/tags","blobs_url":"https://api.github.com/repos/quitefire/automationcourse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/quitefire/automationcourse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/quitefire/automationcourse/git/refs{/sha}","trees_url":"https://api.github.com/repos/quitefire/automationcourse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/quitefire/automationcourse/statuses/{sha}","languages_url":"https://api.github.com/repos/quitefire/automationcourse/languages","stargazers_url":"https://api.github.com/repos/quitefire/automationcourse/stargazers","contributors_url":"https://api.github.com/repos/quitefire/automationcourse/contributors","subscribers_url":"https://api.github.com/repos/quitefire/automationcourse/subscribers","subscription_url":"https://api.github.com/repos/quitefire/automationcourse/subscription","commits_url":"https://api.github.com/repos/quitefire/automationcourse/commits{/sha}","git_commits_url":"https://api.github.com/repos/quitefire/automationcourse/git/commits{/sha}","comments_url":"https://api.github.com/repos/quitefire/automationcourse/comments{/number}","issue_comment_url":"https://api.github.com/repos/quitefire/automationcourse/issues/comments{/number}","contents_url":"https://api.github.com/repos/quitefire/automationcourse/contents/{+path}","compare_url":"https://api.github.com/repos/quitefire/automationcourse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/quitefire/automationcourse/merges","archive_url":"https://api.github.com/repos/quitefire/automationcourse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/quitefire/automationcourse/downloads","issues_url":"https://api.github.com/repos/quitefire/automationcourse/issues{/number}","pulls_url":"https://api.github.com/repos/quitefire/automationcourse/pulls{/number}","milestones_url":"https://api.github.com/repos/quitefire/automationcourse/milestones{/number}","notifications_url":"https://api.github.com/repos/quitefire/automationcourse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/quitefire/automationcourse/labels{/name}","releases_url":"https://api.github.com/repos/quitefire/automationcourse/releases{/id}","deployments_url":"https://api.github.com/repos/quitefire/automationcourse/deployments","created_at":"2017-05-26T11:09:41Z","updated_at":"2017-05-26T11:10:12Z","pushed_at":"2017-05-28T22:54:44Z","git_url":"git://github.com/quitefire/automationcourse.git","ssh_url":"git@github.com:quitefire/automationcourse.git","clone_url":"https://github.com/quitefire/automationcourse.git","svn_url":"https://github.com/quitefire/automationcourse","homepage":null,"size":50,"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":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/quitefire/automationcourse/pulls/5"},"html":{"href":"https://github.com/quitefire/automationcourse/pull/5"},"issue":{"href":"https://api.github.com/repos/quitefire/automationcourse/issues/5"},"comments":{"href":"https://api.github.com/repos/quitefire/automationcourse/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/quitefire/automationcourse/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/quitefire/automationcourse/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/quitefire/automationcourse/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/quitefire/automationcourse/statuses/c65e74c7d27f887252098ad50ed102cc0db80701"}}}}
{"actor":{"display_login":"quitefire"}}