{"action":"created","comment":{"url":"https://api.github.com/repos/eugenp/tutorials/pulls/comments/66397657","id":66397657,"diff_hunk":"@@ -0,0 +1,61 @@\n+package com.baeldung;\n+\n+import java.util.Comparator;\n+\n+//Collector and Collectors Example\n+public class Employee implements Comparator<Employee> {\n+\n+\tprivate String name;\n+\tprivate long salary;\n+\tprivate int deptId;\n+\tprivate int empId;\n+\n+\tpublic Employee() {\n+\t}\n+\n+\tpublic Employee(final int empId, final String name, final long salary, final int deptId) {\n+\t\tsuper();\n+\t\tthis.name = name;\n+\t\tthis.salary = salary;\n+\t\tthis.deptId = deptId;\n+\t\tthis.empId = empId;\n+\t}\n+\n+\tpublic String getName() {\n+\t\treturn name;\n+\t}\n+\n+\tpublic void setName(String name) {\n+\t\tthis.name = name;\n+\t}\n+\n+\tpublic long getSalary() {\n+\t\treturn salary;\n+\t}\n+\n+\tpublic void setSalary(long salary) {\n+\t\tthis.salary = salary;\n+\t}\n+\n+\tpublic int getDeptId() {\n+\t\treturn deptId;\n+\t}\n+\n+\tpublic void setDeptId(int deptId) {\n+\t\tthis.deptId = deptId;\n+\t}\n+\n+\tpublic int getEmpId() {\n+\t\treturn empId;\n+\t}\n+\n+\tpublic void setEmpId(int empId) {\n+\t\tthis.empId = empId;\n+\t}\n+\n+\t@Override\n+\tpublic int compare(Employee o1, Employee o2) {\n+\t\treturn o1.getSalary() > o2.getSalary() ? 1 : o1.getSalary() < o2.getSalary() ? -1 : 0;","path":"core-java-8/src/main/java/com/baeldung/Employee.java","position":58,"original_position":58,"commit_id":"2fdb195ec173ce668403b9c092a5964e978028aa","original_commit_id":"2fdb195ec173ce668403b9c092a5964e978028aa","user":{"login":"pivovarit","id":2182533,"avatar_url":"https://avatars.githubusercontent.com/u/2182533?v=3","gravatar_id":"","url":"https://api.github.com/users/pivovarit","html_url":"https://github.com/pivovarit","followers_url":"https://api.github.com/users/pivovarit/followers","following_url":"https://api.github.com/users/pivovarit/following{/other_user}","gists_url":"https://api.github.com/users/pivovarit/gists{/gist_id}","starred_url":"https://api.github.com/users/pivovarit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pivovarit/subscriptions","organizations_url":"https://api.github.com/users/pivovarit/orgs","repos_url":"https://api.github.com/users/pivovarit/repos","events_url":"https://api.github.com/users/pivovarit/events{/privacy}","received_events_url":"https://api.github.com/users/pivovarit/received_events","type":"User","site_admin":false},"body":"this can be rewritten nicely in java8 way:\r\n\r\nreturn Comparator.comparing(this::getSalary);","created_at":"2016-06-09T08:03:58Z","updated_at":"2016-06-09T08:03:58Z","html_url":"https://github.com/eugenp/tutorials/pull/428#discussion_r66397657","pull_request_url":"https://api.github.com/repos/eugenp/tutorials/pulls/428","_links":{"self":{"href":"https://api.github.com/repos/eugenp/tutorials/pulls/comments/66397657"},"html":{"href":"https://github.com/eugenp/tutorials/pull/428#discussion_r66397657"},"pull_request":{"href":"https://api.github.com/repos/eugenp/tutorials/pulls/428"}}},"pull_request":{"url":"https://api.github.com/repos/eugenp/tutorials/pulls/428","id":70999850,"html_url":"https://github.com/eugenp/tutorials/pull/428","diff_url":"https://github.com/eugenp/tutorials/pull/428.diff","patch_url":"https://github.com/eugenp/tutorials/pull/428.patch","issue_url":"https://api.github.com/repos/eugenp/tutorials/issues/428","number":428,"state":"open","locked":false,"title":"java8 collectors example","user":{"login":"pmuthyala","id":4326824,"avatar_url":"https://avatars.githubusercontent.com/u/4326824?v=3","gravatar_id":"","url":"https://api.github.com/users/pmuthyala","html_url":"https://github.com/pmuthyala","followers_url":"https://api.github.com/users/pmuthyala/followers","following_url":"https://api.github.com/users/pmuthyala/following{/other_user}","gists_url":"https://api.github.com/users/pmuthyala/gists{/gist_id}","starred_url":"https://api.github.com/users/pmuthyala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmuthyala/subscriptions","organizations_url":"https://api.github.com/users/pmuthyala/orgs","repos_url":"https://api.github.com/users/pmuthyala/repos","events_url":"https://api.github.com/users/pmuthyala/events{/privacy}","received_events_url":"https://api.github.com/users/pmuthyala/received_events","type":"User","site_admin":false},"body":"Java8 Collector and Collectors Example","created_at":"2016-05-23T03:07:54Z","updated_at":"2016-06-09T08:03:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d41fd804cc862484f9bee7c0163ce4c1f45fdb3a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/eugenp/tutorials/pulls/428/commits","review_comments_url":"https://api.github.com/repos/eugenp/tutorials/pulls/428/comments","review_comment_url":"https://api.github.com/repos/eugenp/tutorials/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eugenp/tutorials/issues/428/comments","statuses_url":"https://api.github.com/repos/eugenp/tutorials/statuses/2fdb195ec173ce668403b9c092a5964e978028aa","head":{"label":"pmuthyala:master","ref":"master","sha":"2fdb195ec173ce668403b9c092a5964e978028aa","user":{"login":"pmuthyala","id":4326824,"avatar_url":"https://avatars.githubusercontent.com/u/4326824?v=3","gravatar_id":"","url":"https://api.github.com/users/pmuthyala","html_url":"https://github.com/pmuthyala","followers_url":"https://api.github.com/users/pmuthyala/followers","following_url":"https://api.github.com/users/pmuthyala/following{/other_user}","gists_url":"https://api.github.com/users/pmuthyala/gists{/gist_id}","starred_url":"https://api.github.com/users/pmuthyala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmuthyala/subscriptions","organizations_url":"https://api.github.com/users/pmuthyala/orgs","repos_url":"https://api.github.com/users/pmuthyala/repos","events_url":"https://api.github.com/users/pmuthyala/events{/privacy}","received_events_url":"https://api.github.com/users/pmuthyala/received_events","type":"User","site_admin":false},"repo":{"id":59446573,"name":"tutorials","full_name":"pmuthyala/tutorials","owner":{"login":"pmuthyala","id":4326824,"avatar_url":"https://avatars.githubusercontent.com/u/4326824?v=3","gravatar_id":"","url":"https://api.github.com/users/pmuthyala","html_url":"https://github.com/pmuthyala","followers_url":"https://api.github.com/users/pmuthyala/followers","following_url":"https://api.github.com/users/pmuthyala/following{/other_user}","gists_url":"https://api.github.com/users/pmuthyala/gists{/gist_id}","starred_url":"https://api.github.com/users/pmuthyala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmuthyala/subscriptions","organizations_url":"https://api.github.com/users/pmuthyala/orgs","repos_url":"https://api.github.com/users/pmuthyala/repos","events_url":"https://api.github.com/users/pmuthyala/events{/privacy}","received_events_url":"https://api.github.com/users/pmuthyala/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pmuthyala/tutorials","description":"The \"REST With Spring\" Classes:","fork":true,"url":"https://api.github.com/repos/pmuthyala/tutorials","forks_url":"https://api.github.com/repos/pmuthyala/tutorials/forks","keys_url":"https://api.github.com/repos/pmuthyala/tutorials/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pmuthyala/tutorials/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pmuthyala/tutorials/teams","hooks_url":"https://api.github.com/repos/pmuthyala/tutorials/hooks","issue_events_url":"https://api.github.com/repos/pmuthyala/tutorials/issues/events{/number}","events_url":"https://api.github.com/repos/pmuthyala/tutorials/events","assignees_url":"https://api.github.com/repos/pmuthyala/tutorials/assignees{/user}","branches_url":"https://api.github.com/repos/pmuthyala/tutorials/branches{/branch}","tags_url":"https://api.github.com/repos/pmuthyala/tutorials/tags","blobs_url":"https://api.github.com/repos/pmuthyala/tutorials/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pmuthyala/tutorials/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pmuthyala/tutorials/git/refs{/sha}","trees_url":"https://api.github.com/repos/pmuthyala/tutorials/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pmuthyala/tutorials/statuses/{sha}","languages_url":"https://api.github.com/repos/pmuthyala/tutorials/languages","stargazers_url":"https://api.github.com/repos/pmuthyala/tutorials/stargazers","contributors_url":"https://api.github.com/repos/pmuthyala/tutorials/contributors","subscribers_url":"https://api.github.com/repos/pmuthyala/tutorials/subscribers","subscription_url":"https://api.github.com/repos/pmuthyala/tutorials/subscription","commits_url":"https://api.github.com/repos/pmuthyala/tutorials/commits{/sha}","git_commits_url":"https://api.github.com/repos/pmuthyala/tutorials/git/commits{/sha}","comments_url":"https://api.github.com/repos/pmuthyala/tutorials/comments{/number}","issue_comment_url":"https://api.github.com/repos/pmuthyala/tutorials/issues/comments{/number}","contents_url":"https://api.github.com/repos/pmuthyala/tutorials/contents/{+path}","compare_url":"https://api.github.com/repos/pmuthyala/tutorials/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pmuthyala/tutorials/merges","archive_url":"https://api.github.com/repos/pmuthyala/tutorials/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pmuthyala/tutorials/downloads","issues_url":"https://api.github.com/repos/pmuthyala/tutorials/issues{/number}","pulls_url":"https://api.github.com/repos/pmuthyala/tutorials/pulls{/number}","milestones_url":"https://api.github.com/repos/pmuthyala/tutorials/milestones{/number}","notifications_url":"https://api.github.com/repos/pmuthyala/tutorials/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pmuthyala/tutorials/labels{/name}","releases_url":"https://api.github.com/repos/pmuthyala/tutorials/releases{/id}","deployments_url":"https://api.github.com/repos/pmuthyala/tutorials/deployments","created_at":"2016-05-23T02:32:06Z","updated_at":"2016-05-23T02:32:14Z","pushed_at":"2016-06-05T20:04:50Z","git_url":"git://github.com/pmuthyala/tutorials.git","ssh_url":"git@github.com:pmuthyala/tutorials.git","clone_url":"https://github.com/pmuthyala/tutorials.git","svn_url":"https://github.com/pmuthyala/tutorials","homepage":"http://bit.ly/restwithspring","size":12854,"stargazers_count":0,"watchers_count":0,"language":"XSLT","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"eugenp:master","ref":"master","sha":"7335ef2a6519ed765e2fe7f5b89dc94b9ce93cf3","user":{"login":"eugenp","id":1022859,"avatar_url":"https://avatars.githubusercontent.com/u/1022859?v=3","gravatar_id":"","url":"https://api.github.com/users/eugenp","html_url":"https://github.com/eugenp","followers_url":"https://api.github.com/users/eugenp/followers","following_url":"https://api.github.com/users/eugenp/following{/other_user}","gists_url":"https://api.github.com/users/eugenp/gists{/gist_id}","starred_url":"https://api.github.com/users/eugenp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eugenp/subscriptions","organizations_url":"https://api.github.com/users/eugenp/orgs","repos_url":"https://api.github.com/users/eugenp/repos","events_url":"https://api.github.com/users/eugenp/events{/privacy}","received_events_url":"https://api.github.com/users/eugenp/received_events","type":"User","site_admin":false},"repo":{"id":9754983,"name":"tutorials","full_name":"eugenp/tutorials","owner":{"login":"eugenp","id":1022859,"avatar_url":"https://avatars.githubusercontent.com/u/1022859?v=3","gravatar_id":"","url":"https://api.github.com/users/eugenp","html_url":"https://github.com/eugenp","followers_url":"https://api.github.com/users/eugenp/followers","following_url":"https://api.github.com/users/eugenp/following{/other_user}","gists_url":"https://api.github.com/users/eugenp/gists{/gist_id}","starred_url":"https://api.github.com/users/eugenp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eugenp/subscriptions","organizations_url":"https://api.github.com/users/eugenp/orgs","repos_url":"https://api.github.com/users/eugenp/repos","events_url":"https://api.github.com/users/eugenp/events{/privacy}","received_events_url":"https://api.github.com/users/eugenp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eugenp/tutorials","description":"The \"REST With Spring\" Classes:","fork":false,"url":"https://api.github.com/repos/eugenp/tutorials","forks_url":"https://api.github.com/repos/eugenp/tutorials/forks","keys_url":"https://api.github.com/repos/eugenp/tutorials/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eugenp/tutorials/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eugenp/tutorials/teams","hooks_url":"https://api.github.com/repos/eugenp/tutorials/hooks","issue_events_url":"https://api.github.com/repos/eugenp/tutorials/issues/events{/number}","events_url":"https://api.github.com/repos/eugenp/tutorials/events","assignees_url":"https://api.github.com/repos/eugenp/tutorials/assignees{/user}","branches_url":"https://api.github.com/repos/eugenp/tutorials/branches{/branch}","tags_url":"https://api.github.com/repos/eugenp/tutorials/tags","blobs_url":"https://api.github.com/repos/eugenp/tutorials/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eugenp/tutorials/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eugenp/tutorials/git/refs{/sha}","trees_url":"https://api.github.com/repos/eugenp/tutorials/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eugenp/tutorials/statuses/{sha}","languages_url":"https://api.github.com/repos/eugenp/tutorials/languages","stargazers_url":"https://api.github.com/repos/eugenp/tutorials/stargazers","contributors_url":"https://api.github.com/repos/eugenp/tutorials/contributors","subscribers_url":"https://api.github.com/repos/eugenp/tutorials/subscribers","subscription_url":"https://api.github.com/repos/eugenp/tutorials/subscription","commits_url":"https://api.github.com/repos/eugenp/tutorials/commits{/sha}","git_commits_url":"https://api.github.com/repos/eugenp/tutorials/git/commits{/sha}","comments_url":"https://api.github.com/repos/eugenp/tutorials/comments{/number}","issue_comment_url":"https://api.github.com/repos/eugenp/tutorials/issues/comments{/number}","contents_url":"https://api.github.com/repos/eugenp/tutorials/contents/{+path}","compare_url":"https://api.github.com/repos/eugenp/tutorials/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eugenp/tutorials/merges","archive_url":"https://api.github.com/repos/eugenp/tutorials/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eugenp/tutorials/downloads","issues_url":"https://api.github.com/repos/eugenp/tutorials/issues{/number}","pulls_url":"https://api.github.com/repos/eugenp/tutorials/pulls{/number}","milestones_url":"https://api.github.com/repos/eugenp/tutorials/milestones{/number}","notifications_url":"https://api.github.com/repos/eugenp/tutorials/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eugenp/tutorials/labels{/name}","releases_url":"https://api.github.com/repos/eugenp/tutorials/releases{/id}","deployments_url":"https://api.github.com/repos/eugenp/tutorials/deployments","created_at":"2013-04-29T18:26:36Z","updated_at":"2016-06-09T05:43:55Z","pushed_at":"2016-06-08T22:57:23Z","git_url":"git://github.com/eugenp/tutorials.git","ssh_url":"git@github.com:eugenp/tutorials.git","clone_url":"https://github.com/eugenp/tutorials.git","svn_url":"https://github.com/eugenp/tutorials","homepage":"http://bit.ly/restwithspring","size":15269,"stargazers_count":836,"watchers_count":836,"language":"XSLT","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1650,"mirror_url":null,"open_issues_count":26,"forks":1650,"open_issues":26,"watchers":836,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eugenp/tutorials/pulls/428"},"html":{"href":"https://github.com/eugenp/tutorials/pull/428"},"issue":{"href":"https://api.github.com/repos/eugenp/tutorials/issues/428"},"comments":{"href":"https://api.github.com/repos/eugenp/tutorials/issues/428/comments"},"review_comments":{"href":"https://api.github.com/repos/eugenp/tutorials/pulls/428/comments"},"review_comment":{"href":"https://api.github.com/repos/eugenp/tutorials/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eugenp/tutorials/pulls/428/commits"},"statuses":{"href":"https://api.github.com/repos/eugenp/tutorials/statuses/2fdb195ec173ce668403b9c092a5964e978028aa"}}}}
{"actor":{"display_login":"pivovarit"}}