{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/pulls/comments/64993338","id":64993338,"diff_hunk":"@@ -0,0 +1,97 @@\n+package org.jenkinsci.plugins.ewm.definitions;\n+\n+import hudson.Extension;\n+import hudson.model.Describable;\n+import hudson.model.Descriptor;\n+import jenkins.model.Jenkins;\n+import net.sf.json.JSONObject;\n+import org.jenkinsci.plugins.ewm.nodes.DiskNode;\n+import org.kohsuke.stapler.DataBoundConstructor;\n+import org.kohsuke.stapler.StaplerRequest;\n+\n+import javax.annotation.Nonnull;\n+import java.util.List;\n+\n+/**\n+ * @author Alexandru Somai\n+ *         date 5/24/16\n+ */\n+public class Template implements Describable<Template> {\n+\n+    private final String diskPoolRefId;\n+    private final String label;\n+    private final List<DiskNode> diskNodes;\n+\n+    @DataBoundConstructor\n+    public Template(String diskPoolRefId, String label, List<DiskNode> diskNodes) {\n+        this.diskPoolRefId = diskPoolRefId;\n+        this.label = label;\n+        this.diskNodes = diskNodes;\n+    }\n+\n+    @Override\n+    public TemplateDescriptor getDescriptor() {\n+        return (TemplateDescriptor) Jenkins.getInstance().getDescriptorOrDie(getClass());\n+    }\n+\n+    public String getDiskPoolRefId() {\n+        return diskPoolRefId;\n+    }\n+\n+    public String getLabel() {\n+        return label;\n+    }\n+\n+    public List<DiskNode> getDiskNodes() {\n+        return diskNodes;\n+    }\n+\n+    @Extension\n+    public static class TemplateDescriptor extends Descriptor<Template> {\n+\n+        private String diskRefId;\n+        private String label;\n+        private List<DiskNode> diskNodes;\n+\n+        public TemplateDescriptor() {\n+            load();\n+        }\n+\n+        @Override\n+        public boolean configure(StaplerRequest req, JSONObject formData) throws FormException {\n+            req.bindJSON(this, formData);\n+            save();\n+            return super.configure(req, formData);\n+        }\n+\n+        @Nonnull\n+        @Override\n+        public String getDisplayName() {\n+            return \"Template\";\n+        }\n+\n+        public String getDiskRefId() {\n+            return diskRefId;\n+        }\n+\n+        public void setDiskRefId(String diskRefId) {\n+            this.diskRefId = diskRefId;\n+        }\n+\n+        public String getLabel() {","path":"src/main/java/org/jenkinsci/plugins/ewm/definitions/Template.java","position":81,"original_position":81,"commit_id":"d6a013d9d01f9695fbefc7f996c9e727caa71800","original_commit_id":"d6a013d9d01f9695fbefc7f996c9e727caa71800","user":{"login":"oleg-nenashev","id":3000480,"avatar_url":"https://avatars.githubusercontent.com/u/3000480?v=3","gravatar_id":"","url":"https://api.github.com/users/oleg-nenashev","html_url":"https://github.com/oleg-nenashev","followers_url":"https://api.github.com/users/oleg-nenashev/followers","following_url":"https://api.github.com/users/oleg-nenashev/following{/other_user}","gists_url":"https://api.github.com/users/oleg-nenashev/gists{/gist_id}","starred_url":"https://api.github.com/users/oleg-nenashev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oleg-nenashev/subscriptions","organizations_url":"https://api.github.com/users/oleg-nenashev/orgs","repos_url":"https://api.github.com/users/oleg-nenashev/repos","events_url":"https://api.github.com/users/oleg-nenashev/events{/privacy}","received_events_url":"https://api.github.com/users/oleg-nenashev/received_events","type":"User","site_admin":false},"body":"For such methods it's definitely makes sense to define the behavior for empty values. I would nullify them and add a CheckForNull annotation to the method","created_at":"2016-05-28T20:01:50Z","updated_at":"2016-05-28T20:01:50Z","html_url":"https://github.com/jenkinsci/external-workspace-manager-plugin/pull/1#discussion_r64993338","pull_request_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/pulls/comments/64993338"},"html":{"href":"https://github.com/jenkinsci/external-workspace-manager-plugin/pull/1#discussion_r64993338"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/pulls/1","id":71296034,"html_url":"https://github.com/jenkinsci/external-workspace-manager-plugin/pull/1","diff_url":"https://github.com/jenkinsci/external-workspace-manager-plugin/pull/1.diff","patch_url":"https://github.com/jenkinsci/external-workspace-manager-plugin/pull/1.patch","issue_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/issues/1","number":1,"state":"open","locked":false,"title":"[JENKINS-35110] Add exws definitions and templates as global Jenkins …","user":{"login":"alexsomai","id":5720977,"avatar_url":"https://avatars.githubusercontent.com/u/5720977?v=3","gravatar_id":"","url":"https://api.github.com/users/alexsomai","html_url":"https://github.com/alexsomai","followers_url":"https://api.github.com/users/alexsomai/followers","following_url":"https://api.github.com/users/alexsomai/following{/other_user}","gists_url":"https://api.github.com/users/alexsomai/gists{/gist_id}","starred_url":"https://api.github.com/users/alexsomai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexsomai/subscriptions","organizations_url":"https://api.github.com/users/alexsomai/orgs","repos_url":"https://api.github.com/users/alexsomai/repos","events_url":"https://api.github.com/users/alexsomai/events{/privacy}","received_events_url":"https://api.github.com/users/alexsomai/received_events","type":"User","site_admin":false},"body":"…configs. Add exws node property.\r\n\r\nCC @oleg-nenashev @martinda","created_at":"2016-05-24T21:28:26Z","updated_at":"2016-05-28T20:01:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"82b476676f559681a2b52e0a4a1cf08c87d26464","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/pulls/1/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/pulls/1/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/issues/1/comments","statuses_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/statuses/d6a013d9d01f9695fbefc7f996c9e727caa71800","head":{"label":"alexsomai:global-config","ref":"global-config","sha":"d6a013d9d01f9695fbefc7f996c9e727caa71800","user":{"login":"alexsomai","id":5720977,"avatar_url":"https://avatars.githubusercontent.com/u/5720977?v=3","gravatar_id":"","url":"https://api.github.com/users/alexsomai","html_url":"https://github.com/alexsomai","followers_url":"https://api.github.com/users/alexsomai/followers","following_url":"https://api.github.com/users/alexsomai/following{/other_user}","gists_url":"https://api.github.com/users/alexsomai/gists{/gist_id}","starred_url":"https://api.github.com/users/alexsomai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexsomai/subscriptions","organizations_url":"https://api.github.com/users/alexsomai/orgs","repos_url":"https://api.github.com/users/alexsomai/repos","events_url":"https://api.github.com/users/alexsomai/events{/privacy}","received_events_url":"https://api.github.com/users/alexsomai/received_events","type":"User","site_admin":false},"repo":{"id":59319962,"name":"external-workspace-manager-plugin","full_name":"alexsomai/external-workspace-manager-plugin","owner":{"login":"alexsomai","id":5720977,"avatar_url":"https://avatars.githubusercontent.com/u/5720977?v=3","gravatar_id":"","url":"https://api.github.com/users/alexsomai","html_url":"https://github.com/alexsomai","followers_url":"https://api.github.com/users/alexsomai/followers","following_url":"https://api.github.com/users/alexsomai/following{/other_user}","gists_url":"https://api.github.com/users/alexsomai/gists{/gist_id}","starred_url":"https://api.github.com/users/alexsomai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexsomai/subscriptions","organizations_url":"https://api.github.com/users/alexsomai/orgs","repos_url":"https://api.github.com/users/alexsomai/repos","events_url":"https://api.github.com/users/alexsomai/events{/privacy}","received_events_url":"https://api.github.com/users/alexsomai/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexsomai/external-workspace-manager-plugin","description":"","fork":true,"url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin","forks_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/forks","keys_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/teams","hooks_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/hooks","issue_events_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/events","assignees_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/tags","blobs_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/languages","stargazers_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/stargazers","contributors_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/contributors","subscribers_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/subscribers","subscription_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/subscription","commits_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/merges","archive_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/downloads","issues_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/labels{/name}","releases_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/alexsomai/external-workspace-manager-plugin/deployments","created_at":"2016-05-20T19:11:36Z","updated_at":"2016-05-16T12:57:05Z","pushed_at":"2016-05-27T19:35:16Z","git_url":"git://github.com/alexsomai/external-workspace-manager-plugin.git","ssh_url":"git@github.com:alexsomai/external-workspace-manager-plugin.git","clone_url":"https://github.com/alexsomai/external-workspace-manager-plugin.git","svn_url":"https://github.com/alexsomai/external-workspace-manager-plugin","homepage":"","size":23,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":false,"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":"jenkinsci:master","ref":"master","sha":"24f1d4ba6a1d0b98385968d8997ea17dcdea23e5","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":58932444,"name":"external-workspace-manager-plugin","full_name":"jenkinsci/external-workspace-manager-plugin","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/external-workspace-manager-plugin","description":"","fork":false,"url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin","forks_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/forks","keys_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/teams","hooks_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/events","assignees_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/tags","blobs_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/subscription","commits_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/merges","archive_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/downloads","issues_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/deployments","created_at":"2016-05-16T12:57:04Z","updated_at":"2016-05-16T12:57:05Z","pushed_at":"2016-05-27T19:39:21Z","git_url":"git://github.com/jenkinsci/external-workspace-manager-plugin.git","ssh_url":"git@github.com:jenkinsci/external-workspace-manager-plugin.git","clone_url":"https://github.com/jenkinsci/external-workspace-manager-plugin.git","svn_url":"https://github.com/jenkinsci/external-workspace-manager-plugin","homepage":"","size":1,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/pulls/1"},"html":{"href":"https://github.com/jenkinsci/external-workspace-manager-plugin/pull/1"},"issue":{"href":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/issues/1"},"comments":{"href":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/external-workspace-manager-plugin/statuses/d6a013d9d01f9695fbefc7f996c9e727caa71800"}}}}
{"actor":{"display_login":"oleg-nenashev"}}