{"action":"created","comment":{"url":"https://api.github.com/repos/OpenNMS/oce/pulls/comments/236393450","pull_request_review_id":178459561,"id":236393450,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjM5MzQ1MA==","diff_hunk":"@@ -0,0 +1,227 @@\n+/*******************************************************************************\n+ * This file is part of OpenNMS(R).\n+ *\n+ * Copyright (C) 2018 The OpenNMS Group, Inc.\n+ * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc.\n+ *\n+ * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.\n+ *\n+ * OpenNMS(R) is free software: you can redistribute it and/or modify\n+ * it under the terms of the GNU Affero General Public License as published\n+ * by the Free Software Foundation, either version 3 of the License,\n+ * or (at your option) any later version.\n+ *\n+ * OpenNMS(R) is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+ * GNU Affero General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU Affero General Public License\n+ * along with OpenNMS(R).  If not, see:\n+ *      http://www.gnu.org/licenses/\n+ *\n+ * For more information contact:\n+ *     OpenNMS(R) Licensing <license@opennms.org>\n+ *     http://www.opennms.org/\n+ *     http://www.opennms.com/\n+ *******************************************************************************/\n+\n+package org.opennms.oce.datasource.common;\n+\n+import java.util.Objects;\n+\n+import org.opennms.oce.datasource.api.Alarm;\n+import org.opennms.oce.datasource.api.Severity;\n+\n+public final class ImmutableAlarm implements Alarm {\n+    private final String id;\n+    private final long time;\n+    private final Severity severity;\n+    private final String inventoryObjectId;\n+    private final String inventoryObjectType;\n+    private final String summary;\n+    private final String description;\n+\n+    private ImmutableAlarm(Builder builder) {\n+        this.id = builder.id;\n+        this.time = builder.time;\n+        this.severity = builder.severity;\n+        this.inventoryObjectId = builder.inventoryObjectId;\n+        this.inventoryObjectType = builder.inventoryObjectType;\n+        this.summary = builder.summary;\n+        this.description = builder.description;\n+    }\n+\n+    public static class Builder {\n+        private String id;\n+        private long time;\n+        private Severity severity;\n+        private String inventoryObjectId;\n+        private String inventoryObjectType;\n+        private String summary;\n+        private String description;\n+\n+        private Builder() {\n+            time = System.currentTimeMillis();\n+        }\n+\n+        private Builder(Alarm alarm) {\n+            this.id = alarm.getId();\n+            this.time = alarm.getTime();\n+            this.severity = alarm.getSeverity();\n+            this.inventoryObjectId = alarm.getInventoryObjectId();\n+            this.inventoryObjectType = alarm.getInventoryObjectType();\n+            this.summary = alarm.getSummary();\n+            this.description = alarm.getDescription();\n+        }\n+\n+        public String getId() {","path":"datasource/common/src/main/java/org/opennms/oce/datasource/common/ImmutableAlarm.java","position":78,"original_position":78,"commit_id":"0db26a6c9e5a7b7cdd63e2006a0538ca136ed402","original_commit_id":"0db26a6c9e5a7b7cdd63e2006a0538ca136ed402","user":{"login":"j-white","id":1379749,"node_id":"MDQ6VXNlcjEzNzk3NDk=","avatar_url":"https://avatars3.githubusercontent.com/u/1379749?v=4","gravatar_id":"","url":"https://api.github.com/users/j-white","html_url":"https://github.com/j-white","followers_url":"https://api.github.com/users/j-white/followers","following_url":"https://api.github.com/users/j-white/following{/other_user}","gists_url":"https://api.github.com/users/j-white/gists{/gist_id}","starred_url":"https://api.github.com/users/j-white/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j-white/subscriptions","organizations_url":"https://api.github.com/users/j-white/orgs","repos_url":"https://api.github.com/users/j-white/repos","events_url":"https://api.github.com/users/j-white/events{/privacy}","received_events_url":"https://api.github.com/users/j-white/received_events","type":"User","site_admin":false},"body":"Is there any need to include the getters in the builder? Given that we're build the object, we must already know what value we set.","created_at":"2018-11-26T19:25:24Z","updated_at":"2018-11-26T19:29:25Z","html_url":"https://github.com/OpenNMS/oce/pull/44#discussion_r236393450","pull_request_url":"https://api.github.com/repos/OpenNMS/oce/pulls/44","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/OpenNMS/oce/pulls/comments/236393450"},"html":{"href":"https://github.com/OpenNMS/oce/pull/44#discussion_r236393450"},"pull_request":{"href":"https://api.github.com/repos/OpenNMS/oce/pulls/44"}}},"pull_request":{"url":"https://api.github.com/repos/OpenNMS/oce/pulls/44","id":233295940,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzMjk1OTQw","html_url":"https://github.com/OpenNMS/oce/pull/44","diff_url":"https://github.com/OpenNMS/oce/pull/44.diff","patch_url":"https://github.com/OpenNMS/oce/pull/44.patch","issue_url":"https://api.github.com/repos/OpenNMS/oce/issues/44","number":44,"state":"open","locked":false,"title":"OCE-29: Switch to immutable implementation types for Alarms/Situations/Inventory","user":{"login":"mattixtech","id":595194,"node_id":"MDQ6VXNlcjU5NTE5NA==","avatar_url":"https://avatars0.githubusercontent.com/u/595194?v=4","gravatar_id":"","url":"https://api.github.com/users/mattixtech","html_url":"https://github.com/mattixtech","followers_url":"https://api.github.com/users/mattixtech/followers","following_url":"https://api.github.com/users/mattixtech/following{/other_user}","gists_url":"https://api.github.com/users/mattixtech/gists{/gist_id}","starred_url":"https://api.github.com/users/mattixtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattixtech/subscriptions","organizations_url":"https://api.github.com/users/mattixtech/orgs","repos_url":"https://api.github.com/users/mattixtech/repos","events_url":"https://api.github.com/users/mattixtech/events{/privacy}","received_events_url":"https://api.github.com/users/mattixtech/received_events","type":"User","site_admin":false},"body":"This PR adds immutable implementations for the main data types used by OCE.\r\n\r\nI've only updated a bit of the test code before I realized there probably isn't much value updating that, as a result the bean impls are still around and in use in the tests. However all the production code is updated to use immutable types.","created_at":"2018-11-24T02:09:29Z","updated_at":"2018-11-26T19:29:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"55d7c4dd7a9911caa0f2708cbe9e811635f3ee3a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/OpenNMS/oce/pulls/44/commits","review_comments_url":"https://api.github.com/repos/OpenNMS/oce/pulls/44/comments","review_comment_url":"https://api.github.com/repos/OpenNMS/oce/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenNMS/oce/issues/44/comments","statuses_url":"https://api.github.com/repos/OpenNMS/oce/statuses/0db26a6c9e5a7b7cdd63e2006a0538ca136ed402","head":{"label":"OpenNMS:mbrooks/OCE-29","ref":"mbrooks/OCE-29","sha":"0db26a6c9e5a7b7cdd63e2006a0538ca136ed402","user":{"login":"OpenNMS","id":2972482,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5NzI0ODI=","avatar_url":"https://avatars2.githubusercontent.com/u/2972482?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenNMS","html_url":"https://github.com/OpenNMS","followers_url":"https://api.github.com/users/OpenNMS/followers","following_url":"https://api.github.com/users/OpenNMS/following{/other_user}","gists_url":"https://api.github.com/users/OpenNMS/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenNMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenNMS/subscriptions","organizations_url":"https://api.github.com/users/OpenNMS/orgs","repos_url":"https://api.github.com/users/OpenNMS/repos","events_url":"https://api.github.com/users/OpenNMS/events{/privacy}","received_events_url":"https://api.github.com/users/OpenNMS/received_events","type":"Organization","site_admin":false},"repo":{"id":128952957,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg5NTI5NTc=","name":"oce","full_name":"OpenNMS/oce","private":false,"owner":{"login":"OpenNMS","id":2972482,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5NzI0ODI=","avatar_url":"https://avatars2.githubusercontent.com/u/2972482?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenNMS","html_url":"https://github.com/OpenNMS","followers_url":"https://api.github.com/users/OpenNMS/followers","following_url":"https://api.github.com/users/OpenNMS/following{/other_user}","gists_url":"https://api.github.com/users/OpenNMS/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenNMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenNMS/subscriptions","organizations_url":"https://api.github.com/users/OpenNMS/orgs","repos_url":"https://api.github.com/users/OpenNMS/repos","events_url":"https://api.github.com/users/OpenNMS/events{/privacy}","received_events_url":"https://api.github.com/users/OpenNMS/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/OpenNMS/oce","description":"OpenNMS Correlation Engine","fork":false,"url":"https://api.github.com/repos/OpenNMS/oce","forks_url":"https://api.github.com/repos/OpenNMS/oce/forks","keys_url":"https://api.github.com/repos/OpenNMS/oce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenNMS/oce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenNMS/oce/teams","hooks_url":"https://api.github.com/repos/OpenNMS/oce/hooks","issue_events_url":"https://api.github.com/repos/OpenNMS/oce/issues/events{/number}","events_url":"https://api.github.com/repos/OpenNMS/oce/events","assignees_url":"https://api.github.com/repos/OpenNMS/oce/assignees{/user}","branches_url":"https://api.github.com/repos/OpenNMS/oce/branches{/branch}","tags_url":"https://api.github.com/repos/OpenNMS/oce/tags","blobs_url":"https://api.github.com/repos/OpenNMS/oce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenNMS/oce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenNMS/oce/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenNMS/oce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenNMS/oce/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenNMS/oce/languages","stargazers_url":"https://api.github.com/repos/OpenNMS/oce/stargazers","contributors_url":"https://api.github.com/repos/OpenNMS/oce/contributors","subscribers_url":"https://api.github.com/repos/OpenNMS/oce/subscribers","subscription_url":"https://api.github.com/repos/OpenNMS/oce/subscription","commits_url":"https://api.github.com/repos/OpenNMS/oce/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenNMS/oce/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenNMS/oce/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenNMS/oce/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenNMS/oce/contents/{+path}","compare_url":"https://api.github.com/repos/OpenNMS/oce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenNMS/oce/merges","archive_url":"https://api.github.com/repos/OpenNMS/oce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenNMS/oce/downloads","issues_url":"https://api.github.com/repos/OpenNMS/oce/issues{/number}","pulls_url":"https://api.github.com/repos/OpenNMS/oce/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenNMS/oce/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenNMS/oce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenNMS/oce/labels{/name}","releases_url":"https://api.github.com/repos/OpenNMS/oce/releases{/id}","deployments_url":"https://api.github.com/repos/OpenNMS/oce/deployments","created_at":"2018-04-10T15:14:02Z","updated_at":"2018-11-26T19:28:42Z","pushed_at":"2018-11-26T19:28:40Z","git_url":"git://github.com/OpenNMS/oce.git","ssh_url":"git@github.com:OpenNMS/oce.git","clone_url":"https://github.com/OpenNMS/oce.git","svn_url":"https://github.com/OpenNMS/oce","homepage":null,"size":21753,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"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":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":5,"watchers":1,"default_branch":"master"}},"base":{"label":"OpenNMS:master","ref":"master","sha":"9658910f80aba10f8483794f4c7fa39520d13303","user":{"login":"OpenNMS","id":2972482,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5NzI0ODI=","avatar_url":"https://avatars2.githubusercontent.com/u/2972482?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenNMS","html_url":"https://github.com/OpenNMS","followers_url":"https://api.github.com/users/OpenNMS/followers","following_url":"https://api.github.com/users/OpenNMS/following{/other_user}","gists_url":"https://api.github.com/users/OpenNMS/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenNMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenNMS/subscriptions","organizations_url":"https://api.github.com/users/OpenNMS/orgs","repos_url":"https://api.github.com/users/OpenNMS/repos","events_url":"https://api.github.com/users/OpenNMS/events{/privacy}","received_events_url":"https://api.github.com/users/OpenNMS/received_events","type":"Organization","site_admin":false},"repo":{"id":128952957,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg5NTI5NTc=","name":"oce","full_name":"OpenNMS/oce","private":false,"owner":{"login":"OpenNMS","id":2972482,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5NzI0ODI=","avatar_url":"https://avatars2.githubusercontent.com/u/2972482?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenNMS","html_url":"https://github.com/OpenNMS","followers_url":"https://api.github.com/users/OpenNMS/followers","following_url":"https://api.github.com/users/OpenNMS/following{/other_user}","gists_url":"https://api.github.com/users/OpenNMS/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenNMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenNMS/subscriptions","organizations_url":"https://api.github.com/users/OpenNMS/orgs","repos_url":"https://api.github.com/users/OpenNMS/repos","events_url":"https://api.github.com/users/OpenNMS/events{/privacy}","received_events_url":"https://api.github.com/users/OpenNMS/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/OpenNMS/oce","description":"OpenNMS Correlation Engine","fork":false,"url":"https://api.github.com/repos/OpenNMS/oce","forks_url":"https://api.github.com/repos/OpenNMS/oce/forks","keys_url":"https://api.github.com/repos/OpenNMS/oce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenNMS/oce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenNMS/oce/teams","hooks_url":"https://api.github.com/repos/OpenNMS/oce/hooks","issue_events_url":"https://api.github.com/repos/OpenNMS/oce/issues/events{/number}","events_url":"https://api.github.com/repos/OpenNMS/oce/events","assignees_url":"https://api.github.com/repos/OpenNMS/oce/assignees{/user}","branches_url":"https://api.github.com/repos/OpenNMS/oce/branches{/branch}","tags_url":"https://api.github.com/repos/OpenNMS/oce/tags","blobs_url":"https://api.github.com/repos/OpenNMS/oce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenNMS/oce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenNMS/oce/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenNMS/oce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenNMS/oce/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenNMS/oce/languages","stargazers_url":"https://api.github.com/repos/OpenNMS/oce/stargazers","contributors_url":"https://api.github.com/repos/OpenNMS/oce/contributors","subscribers_url":"https://api.github.com/repos/OpenNMS/oce/subscribers","subscription_url":"https://api.github.com/repos/OpenNMS/oce/subscription","commits_url":"https://api.github.com/repos/OpenNMS/oce/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenNMS/oce/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenNMS/oce/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenNMS/oce/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenNMS/oce/contents/{+path}","compare_url":"https://api.github.com/repos/OpenNMS/oce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenNMS/oce/merges","archive_url":"https://api.github.com/repos/OpenNMS/oce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenNMS/oce/downloads","issues_url":"https://api.github.com/repos/OpenNMS/oce/issues{/number}","pulls_url":"https://api.github.com/repos/OpenNMS/oce/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenNMS/oce/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenNMS/oce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenNMS/oce/labels{/name}","releases_url":"https://api.github.com/repos/OpenNMS/oce/releases{/id}","deployments_url":"https://api.github.com/repos/OpenNMS/oce/deployments","created_at":"2018-04-10T15:14:02Z","updated_at":"2018-11-26T19:28:42Z","pushed_at":"2018-11-26T19:28:40Z","git_url":"git://github.com/OpenNMS/oce.git","ssh_url":"git@github.com:OpenNMS/oce.git","clone_url":"https://github.com/OpenNMS/oce.git","svn_url":"https://github.com/OpenNMS/oce","homepage":null,"size":21753,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"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":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":5,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenNMS/oce/pulls/44"},"html":{"href":"https://github.com/OpenNMS/oce/pull/44"},"issue":{"href":"https://api.github.com/repos/OpenNMS/oce/issues/44"},"comments":{"href":"https://api.github.com/repos/OpenNMS/oce/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenNMS/oce/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenNMS/oce/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenNMS/oce/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/OpenNMS/oce/statuses/0db26a6c9e5a7b7cdd63e2006a0538ca136ed402"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"j-white"}}