diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java index 8753a1a3..d5715a3a 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java @@ -341,8 +341,8 @@ public Optional getFolderJob(Job job) throws IOException { * the job. * @throws IOException in case of an error. */ - public void createJob(String jobName, String jobXml) throws IOException { - createJob(null, jobName, jobXml, false); + public JenkinsServer createJob(String jobName, String jobXml) throws IOException { + return createJob(null, jobName, jobXml, false); } /** @@ -355,8 +355,8 @@ public void createJob(String jobName, String jobXml) throws IOException { * false otherwise. * @throws IOException in case of an error. */ - public void createJob(String jobName, String jobXml, Boolean crumbFlag) throws IOException { - createJob(null, jobName, jobXml, crumbFlag); + public JenkinsServer createJob(String jobName, String jobXml, Boolean crumbFlag) throws IOException { + return createJob(null, jobName, jobXml, crumbFlag); } /** @@ -369,8 +369,8 @@ public void createJob(String jobName, String jobXml, Boolean crumbFlag) throws I * the job. * @throws IOException in case of an error. */ - public void createJob(FolderJob folder, String jobName, String jobXml) throws IOException { - createJob(folder, jobName, jobXml, false); + public JenkinsServer createJob(FolderJob folder, String jobName, String jobXml) throws IOException { + return createJob(folder, jobName, jobXml, false); } /** @@ -385,8 +385,10 @@ public void createJob(FolderJob folder, String jobName, String jobXml) throws IO * false otherwise. * @throws IOException in case of an error. */ - public void createJob(FolderJob folder, String jobName, String jobXml, Boolean crumbFlag) throws IOException { + public JenkinsServer createJob(FolderJob folder, String jobName, String jobXml, Boolean crumbFlag) + throws IOException { client.post_xml(UrlUtils.toBaseUrl(folder) + "createItem?name=" + EncodingUtils.formParameter(jobName), jobXml, crumbFlag); + return this; } /** @@ -396,8 +398,8 @@ public void createJob(FolderJob folder, String jobName, String jobXml, Boolean c * @param viewXml The configuration for the view. * @throws IOException in case of an error. */ - public void createView(String viewName, String viewXml) throws IOException { - createView(null, viewName, viewXml, false); + public JenkinsServer createView(String viewName, String viewXml) throws IOException { + return createView(null, viewName, viewXml, false); } /** @@ -409,8 +411,8 @@ public void createView(String viewName, String viewXml) throws IOException { * false otherwise. * @throws IOException in case of an error. */ - public void createView(String viewName, String viewXml, Boolean crumbFlag) throws IOException { - createView(null, viewName, viewXml, crumbFlag); + public JenkinsServer createView(String viewName, String viewXml, Boolean crumbFlag) throws IOException { + return createView(null, viewName, viewXml, crumbFlag); } /** @@ -422,8 +424,8 @@ public void createView(String viewName, String viewXml, Boolean crumbFlag) throw * @param viewXml The configuration for the view. * @throws IOException in case of an error. */ - public void createView(FolderJob folder, String viewName, String viewXml) throws IOException { - createView(folder, viewName, viewXml, false); + public JenkinsServer createView(FolderJob folder, String viewName, String viewXml) throws IOException { + return createView(folder, viewName, viewXml, false); } /** @@ -437,9 +439,11 @@ public void createView(FolderJob folder, String viewName, String viewXml) throws * false otherwise. * @throws IOException in case of an error. */ - public void createView(FolderJob folder, String viewName, String viewXml, Boolean crumbFlag) throws IOException { + public JenkinsServer createView(FolderJob folder, String viewName, String viewXml, Boolean crumbFlag) + throws IOException { client.post_xml(UrlUtils.toBaseUrl(folder) + "createView?name=" + EncodingUtils.formParameter(viewName), viewXml, crumbFlag); + return this; } /** @@ -448,8 +452,8 @@ public void createView(FolderJob folder, String viewName, String viewXml, Boolea * @param folderName name of the folder. * @throws IOException in case of an error. */ - public void createFolder(String folderName) throws IOException { - createFolder(null, folderName, false); + public JenkinsServer createFolder(String folderName) throws IOException { + return createFolder(null, folderName, false); } /** @@ -460,8 +464,8 @@ public void createFolder(String folderName) throws IOException { * false otherwise. * @throws IOException in case of an error. */ - public void createFolder(String folderName, Boolean crumbFlag) throws IOException { - createFolder(null, folderName, crumbFlag); + public JenkinsServer createFolder(String folderName, Boolean crumbFlag) throws IOException { + return createFolder(null, folderName, crumbFlag); } /** @@ -471,8 +475,8 @@ public void createFolder(String folderName, Boolean crumbFlag) throws IOExceptio * @param jobName name of the job. * @throws IOException in case of an error. */ - public void createFolder(FolderJob folder, String jobName) throws IOException { - createFolder(folder, jobName, false); + public JenkinsServer createFolder(FolderJob folder, String jobName) throws IOException { + return createFolder(folder, jobName, false); } /** @@ -484,12 +488,13 @@ public void createFolder(FolderJob folder, String jobName) throws IOException { * false otherwise. * @throws IOException in case of an error. */ - public void createFolder(FolderJob folder, String jobName, Boolean crumbFlag) throws IOException { + public JenkinsServer createFolder(FolderJob folder, String jobName, Boolean crumbFlag) throws IOException { // https://gist.github.com/stuart-warren/7786892 was slightly helpful // here ImmutableMap params = ImmutableMap.of("mode", "com.cloudbees.hudson.plugins.folder.Folder", "name", EncodingUtils.formParameter(jobName), "from", "", "Submit", "OK"); client.post_form(UrlUtils.toBaseUrl(folder) + "createItem?", params, crumbFlag); + return this; } /** @@ -573,20 +578,24 @@ public PluginManager getPluginManager() throws IOException { * @param viewXml the view configuration. * @throws IOException in case of an error. */ - public void updateView(String viewName, String viewXml) throws IOException { - this.updateView(viewName, viewXml, true); + public JenkinsServer updateView(String viewName, String viewXml) throws IOException { + return this.updateView(viewName, viewXml, true); } - public void updateView(String viewName, String viewXml, boolean crumbFlag) throws IOException { + public JenkinsServer updateView(String viewName, String viewXml, boolean crumbFlag) throws IOException { client.post_xml("/view/" + EncodingUtils.encode(viewName) + "/config.xml", viewXml, crumbFlag); + return this; } - public void updateView(FolderJob folder, String viewName, String viewXml) throws IOException { + public JenkinsServer updateView(FolderJob folder, String viewName, String viewXml) throws IOException { client.post_xml(UrlUtils.toBaseUrl(folder) + "view/" + EncodingUtils.encode(viewName) + "/config.xml", viewXml, true); + return this; } - public void updateView(FolderJob folder, String viewName, String viewXml, boolean crumbFlag) throws IOException { + public JenkinsServer updateView(FolderJob folder, String viewName, String viewXml, boolean crumbFlag) + throws IOException { client.post_xml(UrlUtils.toBaseUrl(folder) + "view/" + EncodingUtils.encode(viewName) + "/config.xml", viewXml, crumbFlag); + return this; } /** @@ -596,8 +605,8 @@ public void updateView(FolderJob folder, String viewName, String viewXml, boolea * @param jobXml the configuration to be used for updating. * @throws IOException in case of an error. */ - public void updateJob(String jobName, String jobXml) throws IOException { - this.updateJob(jobName, jobXml, true); + public JenkinsServer updateJob(String jobName, String jobXml) throws IOException { + return this.updateJob(jobName, jobXml, true); } /** @@ -608,8 +617,8 @@ public void updateJob(String jobName, String jobXml) throws IOException { * @param crumbFlag true/false. * @throws IOException in case of an error. */ - public void updateJob(String jobName, String jobXml, boolean crumbFlag) throws IOException { - updateJob(null, jobName, jobXml, crumbFlag); + public JenkinsServer updateJob(String jobName, String jobXml, boolean crumbFlag) throws IOException { + return updateJob(null, jobName, jobXml, crumbFlag); } /** @@ -621,8 +630,10 @@ public void updateJob(String jobName, String jobXml, boolean crumbFlag) throws I * @param crumbFlag true/false. * @throws IOException in case of an error. */ - public void updateJob(FolderJob folder, String jobName, String jobXml, boolean crumbFlag) throws IOException { + public JenkinsServer updateJob(FolderJob folder, String jobName, String jobXml, boolean crumbFlag) + throws IOException { client.post_xml(UrlUtils.toJobBaseUrl(folder, jobName) + "/config.xml", jobXml, crumbFlag); + return this; } /** @@ -634,12 +645,12 @@ public void updateJob(FolderJob folder, String jobName, String jobXml, boolean c * @throws JAXBException in case of an error. * @throws DocumentException in case of an error. */ - public void addStringParam(String jobName, String name, String description, String defaultValue) + public JenkinsServer addStringParam(String jobName, String name, String description, String defaultValue) throws IOException, JAXBException, DocumentException { String jobXml = this.getJobXml(jobName); JobConfiguration jobConf = new JobConfiguration(jobXml); jobXml = jobConf.addStringParam(name, description, defaultValue).asXml(); - this.updateJob(jobName, jobXml); + return this.updateJob(jobName, jobXml); } /** @@ -647,13 +658,13 @@ public void addStringParam(String jobName, String name, String description, Stri * * @throws IOException in case of an error. */ - public void quietDown() throws IOException { + public JenkinsServer quietDown() throws IOException { try { client.get("/quietDown/"); } catch (org.apache.http.client.ClientProtocolException e) { LOGGER.error("quietDown()", e); } - + return this; } /** @@ -661,12 +672,13 @@ public void quietDown() throws IOException { * * @throws IOException in case of an error. */ - public void cancelQuietDown() throws IOException { + public JenkinsServer cancelQuietDown() throws IOException { try { client.post("/cancelQuietDown/"); } catch (org.apache.http.client.ClientProtocolException e) { LOGGER.error("cancelQuietDown()", e); } + return this; } /** @@ -677,8 +689,8 @@ public void cancelQuietDown() throws IOException { * * @throws IOException in case of an error. */ - public void deleteJob(FolderJob folder, String jobName) throws IOException { - deleteJob(folder, jobName, false); + public JenkinsServer deleteJob(FolderJob folder, String jobName) throws IOException { + return deleteJob(folder, jobName, false); } /** @@ -689,8 +701,9 @@ public void deleteJob(FolderJob folder, String jobName) throws IOException { * @param crumbFlag The crumbFlag * @throws IOException in case of problems. */ - public void deleteJob(FolderJob folder, String jobName, boolean crumbFlag) throws IOException { + public JenkinsServer deleteJob(FolderJob folder, String jobName, boolean crumbFlag) throws IOException { client.post(UrlUtils.toJobBaseUrl(folder, jobName) + "/doDelete", crumbFlag); + return this; } /** @@ -699,8 +712,8 @@ public void deleteJob(FolderJob folder, String jobName, boolean crumbFlag) throw * @param jobName The name of the job which should be deleted. * @throws IOException in case of an error. */ - public void deleteJob(String jobName) throws IOException { - deleteJob(jobName, false); + public JenkinsServer deleteJob(String jobName) throws IOException { + return deleteJob(jobName, false); } /** @@ -711,8 +724,9 @@ public void deleteJob(String jobName) throws IOException { * false otherwise. * @throws IOException In case of an failure. */ - public void deleteJob(String jobName, boolean crumbFlag) throws IOException { + public JenkinsServer deleteJob(String jobName, boolean crumbFlag) throws IOException { client.post("/job/" + EncodingUtils.encode(jobName) + "/doDelete", crumbFlag); + return this; } /** @@ -721,8 +735,8 @@ public void deleteJob(String jobName, boolean crumbFlag) throws IOException { * @param jobName The name of the job which should be disabled. * @throws IOException in case of an error. */ - public void disableJob(String jobName) throws IOException { - disableJob(jobName, false); + public JenkinsServer disableJob(String jobName) throws IOException { + return disableJob(jobName, false); } /** @@ -733,8 +747,9 @@ public void disableJob(String jobName) throws IOException { * false otherwise. * @throws IOException In case of an failure. */ - public void disableJob(String jobName, boolean crumbFlag) throws IOException { + public JenkinsServer disableJob(String jobName, boolean crumbFlag) throws IOException { client.post("/job/" + EncodingUtils.encode(jobName) + "/disable", crumbFlag); + return this; } /** @@ -743,8 +758,8 @@ public void disableJob(String jobName, boolean crumbFlag) throws IOException { * @param jobName name of the job which should be enabled. * @throws IOException In case of an failure. */ - public void enableJob(String jobName) throws IOException { - enableJob( jobName, false ); + public JenkinsServer enableJob(String jobName) throws IOException { + return enableJob(jobName, false); } /** @@ -755,8 +770,9 @@ public void enableJob(String jobName) throws IOException { * false otherwise. * @throws IOException In case of an failure. */ - public void enableJob(String jobName, boolean crumbFlag) throws IOException { + public JenkinsServer enableJob(String jobName, boolean crumbFlag) throws IOException { client.post("/job/" + EncodingUtils.encode(jobName) + "/enable", crumbFlag); + return this; } /** @@ -842,8 +858,8 @@ public Build getBuild(QueueItem q) throws IOException { * @param newJobName The new job name. * @throws IOException In case of a failure. */ - public void renameJob(String oldJobName, String newJobName) throws IOException { - renameJob(null, oldJobName, newJobName, false); + public JenkinsServer renameJob(String oldJobName, String newJobName) throws IOException { + return renameJob(null, oldJobName, newJobName, false); } /** @@ -855,8 +871,9 @@ public void renameJob(String oldJobName, String newJobName) throws IOException { * false otherwise. * @throws IOException In case of a failure. */ - public void renameJob(String oldJobName, String newJobName, Boolean crumbFlag) throws IOException { + public JenkinsServer renameJob(String oldJobName, String newJobName, Boolean crumbFlag) throws IOException { renameJob(null, oldJobName, newJobName, crumbFlag); + return this; } /** @@ -867,8 +884,8 @@ public void renameJob(String oldJobName, String newJobName, Boolean crumbFlag) t * @param newJobName The new job name. * @throws IOException In case of a failure. */ - public void renameJob(FolderJob folder, String oldJobName, String newJobName) throws IOException { - renameJob(folder, oldJobName, newJobName, false); + public JenkinsServer renameJob(FolderJob folder, String oldJobName, String newJobName) throws IOException { + return renameJob(folder, oldJobName, newJobName, false); } /** @@ -881,11 +898,12 @@ public void renameJob(FolderJob folder, String oldJobName, String newJobName) th * false otherwise. * @throws IOException In case of a failure. */ - public void renameJob(FolderJob folder, String oldJobName, String newJobName, Boolean crumbFlag) + public JenkinsServer renameJob(FolderJob folder, String oldJobName, String newJobName, Boolean crumbFlag) throws IOException { client.post(UrlUtils.toJobBaseUrl(folder, oldJobName) + "/doRename?newName=" + EncodingUtils.formParameter(newJobName), crumbFlag); + return this; } @@ -910,12 +928,13 @@ public void close() { * @throws IOException * in case of an error. */ - public void restart(Boolean crumbFlag) throws IOException { + public JenkinsServer restart(Boolean crumbFlag) throws IOException { try { client.post("/restart", crumbFlag); } catch (org.apache.http.client.ClientProtocolException e) { LOGGER.error("restart()", e); } + return this; } /** @@ -928,12 +947,13 @@ public void restart(Boolean crumbFlag) throws IOException { * @throws IOException * in case of an error. */ - public void safeRestart(Boolean crumbFlag) throws IOException { + public JenkinsServer safeRestart(Boolean crumbFlag) throws IOException { try { client.post("/safeRestart", crumbFlag); } catch (org.apache.http.client.ClientProtocolException e) { LOGGER.error("safeRestart()", e); } + return this; } /** @@ -945,13 +965,13 @@ public void safeRestart(Boolean crumbFlag) throws IOException { * @throws IOException * in case of an error. */ - // - public void exit(Boolean crumbFlag) throws IOException { + public JenkinsServer exit(Boolean crumbFlag) throws IOException { try { client.post("/exit", crumbFlag); } catch (org.apache.http.client.ClientProtocolException e) { LOGGER.error("exit()", e); } + return this; } /** @@ -964,11 +984,12 @@ public void exit(Boolean crumbFlag) throws IOException { * @throws IOException * in case of an error. */ - public void safeExit(Boolean crumbFlag) throws IOException { + public JenkinsServer safeExit(Boolean crumbFlag) throws IOException { try { client.post("/safeExit", crumbFlag); } catch (org.apache.http.client.ClientProtocolException e) { LOGGER.error("safeExit()", e); } + return this; } } diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Artifact.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Artifact.java index 6d0b0e69..a6c7a2f0 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Artifact.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Artifact.java @@ -16,24 +16,27 @@ public String getDisplayPath() { return displayPath; } - public void setDisplayPath(String displayPath) { + public Artifact setDisplayPath(String displayPath) { this.displayPath = displayPath; + return this; } public String getFileName() { return fileName; } - public void setFileName(String fileName) { + public Artifact setFileName(String fileName) { this.fileName = fileName; + return this; } public String getRelativePath() { return relativePath; } - public void setRelativePath(String relativePath) { + public Artifact setRelativePath(String relativePath) { this.relativePath = relativePath; + return this; } @Override diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BaseModel.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BaseModel.java index 95f70bab..9c850ba2 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BaseModel.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BaseModel.java @@ -43,7 +43,8 @@ public JenkinsHttpConnection getClient() { * Set the HTTP client. * @param client {@link JenkinsHttpConnection}. */ - public void setClient(final JenkinsHttpConnection client) { + public BaseModel setClient(final JenkinsHttpConnection client) { this.client = client; + return this; } } diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Build.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Build.java index 2d936d1b..470707d9 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Build.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Build.java @@ -83,16 +83,19 @@ public String getUrl() { return url; } - protected void setNumber(int number) { + protected Build setNumber(int number) { this.number = number; + return this; } - protected void setQueueId(int queueId) { + protected Build setQueueId(int queueId) { this.queueId = queueId; + return this; } - protected void setUrl(String url) { + protected Build setUrl(String url) { this.url = url; + return this; } /** diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildCause.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildCause.java index ab15f94f..821a027f 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildCause.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildCause.java @@ -29,48 +29,54 @@ public String getShortDescription() { return shortDescription; } - public void setShortDescription(String shortDescription) { + public BuildCause setShortDescription(String shortDescription) { this.shortDescription = shortDescription; + return this; } public int getUpstreamBuild() { return upstreamBuild; } - public void setUpstreamBuild(Integer upstreamBuild) { + public BuildCause setUpstreamBuild(Integer upstreamBuild) { this.upstreamBuild = upstreamBuild; + return this; } public String getUpstreamProject() { return upstreamProject; } - public void setUpstreamProject(String upstreamProject) { + public BuildCause setUpstreamProject(String upstreamProject) { this.upstreamProject = upstreamProject; + return this; } public String getUpstreamUrl() { return upstreamUrl; } - public void setUpstreamUrl(String upstreamUrl) { + public BuildCause setUpstreamUrl(String upstreamUrl) { this.upstreamUrl = upstreamUrl; + return this; } public String getUserId() { return userId; } - public void setUserId(String userId) { + public BuildCause setUserId(String userId) { this.userId = userId; + return this; } public String getUserName() { return userName; } - public void setUserName(String userName) { + public BuildCause setUserName(String userName) { this.userName = userName; + return this; } @Override diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildChangeSet.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildChangeSet.java index 1987cc49..2b7cf520 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildChangeSet.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildChangeSet.java @@ -24,8 +24,9 @@ public class BuildChangeSet { /** * @param items {@link BuildChangeSet} */ - public void setItems(List items) { + public BuildChangeSet setItems(List items) { this.items = items; + return this; } /** @@ -45,8 +46,9 @@ public String getKind() { /** * @param kind the kind of (usually svn, git). */ - public void setKind(String kind) { + public BuildChangeSet setKind(String kind) { this.kind = kind; + return this; } @Override diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildChangeSetAuthor.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildChangeSetAuthor.java index 9abdd1ba..af416581 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildChangeSetAuthor.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildChangeSetAuthor.java @@ -13,16 +13,18 @@ public String getAbsoluteUrl() { return absoluteUrl; } - public void setAbsoluteUrl(String absoluteUrl) { + public BuildChangeSetAuthor setAbsoluteUrl(String absoluteUrl) { this.absoluteUrl = absoluteUrl; + return this; } public String getFullName() { return fullName; } - public void setFullName(String fullName) { + public BuildChangeSetAuthor setFullName(String fullName) { this.fullName = fullName; + return this; } @Override diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildChangeSetItem.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildChangeSetItem.java index e817d12b..922a19b1 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildChangeSetItem.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildChangeSetItem.java @@ -27,72 +27,81 @@ public List getAffectedPaths() { return affectedPaths; } - public void setAffectedPaths(List affectedPaths) { + public BuildChangeSetItem setAffectedPaths(List affectedPaths) { this.affectedPaths = affectedPaths; + return this; } public String getCommitId() { return commitId; } - public void setCommitId(String commitId) { + public BuildChangeSetItem setCommitId(String commitId) { this.commitId = commitId; + return this; } public String getTimestamp() { return timestamp; } - public void setTimestamp(String timeStamp) { + public BuildChangeSetItem setTimestamp(String timeStamp) { this.timestamp = timeStamp; + return this; } public String getComment() { return comment; } - public void setComment(String comment) { + public BuildChangeSetItem setComment(String comment) { this.comment = comment; + return this; } public String getDate() { return date; } - public void setDate(String date) { + public BuildChangeSetItem setDate(String date) { this.date = date; + return this; } public String getId() { return id; } - public void setId(String id) { + public BuildChangeSetItem setId(String id) { this.id = id; + return this; } public String getMsg() { return msg; } - public void setMsg(String msg) { + public BuildChangeSetItem setMsg(String msg) { this.msg = msg; + return this; } public List getPaths() { return paths; } - public void setPaths(List paths) { + public BuildChangeSetItem setPaths(List paths) { this.paths = paths; + return this; } public BuildChangeSetAuthor getAuthor() { return author; } - public void setAuthor(BuildChangeSetAuthor author) { + public BuildChangeSetItem setAuthor(BuildChangeSetAuthor author) { this.author = author; + return this; } @Override diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildChangeSetPath.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildChangeSetPath.java index e5078f3a..5758ee78 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildChangeSetPath.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildChangeSetPath.java @@ -27,16 +27,18 @@ public String getEditType() { * @param editType the SCM operation, add or edit or delete * @see EditType */ - public void setEditType(String editType) { + public BuildChangeSetPath setEditType(String editType) { this.editType = editType; + return this; } public String getFile() { return file; } - public void setFile(String file) { + public BuildChangeSetPath setFile(String file) { this.file = file; + return this; } @Override diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildWithDetails.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildWithDetails.java index 20ffbadc..d8b30a24 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildWithDetails.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildWithDetails.java @@ -199,7 +199,7 @@ public boolean apply(Map action) { * @param crumbFlag true or false. * @throws IOException in case of errors. */ - public void updateDisplayNameAndDescription(String displayName, String description, boolean crumbFlag) + public BuildWithDetails updateDisplayNameAndDescription(String displayName, String description, boolean crumbFlag) throws IOException { Objects.requireNonNull(displayName, "displayName is not allowed to be null."); Objects.requireNonNull(description, "description is not allowed to be null."); @@ -207,6 +207,7 @@ public void updateDisplayNameAndDescription(String displayName, String descripti ImmutableMap params = ImmutableMap.of("displayName", displayName, "description", description, "core:apply", "", "Submit", "Save"); client.post_form(this.getUrl() + "/configSubmit?", params, crumbFlag); + return this; } /** @@ -217,8 +218,8 @@ public void updateDisplayNameAndDescription(String displayName, String descripti * @param description The description which should be set. * @throws IOException in case of errors. */ - public void updateDisplayNameAndDescription(String displayName, String description) throws IOException { - updateDisplayNameAndDescription(displayName, description, false); + public BuildWithDetails updateDisplayNameAndDescription(String displayName, String description) throws IOException { + return updateDisplayNameAndDescription(displayName, description, false); } /** @@ -228,13 +229,14 @@ public void updateDisplayNameAndDescription(String displayName, String descripti * @param crumbFlag true or false. * @throws IOException in case of errors. */ - public void updateDisplayName(String displayName, boolean crumbFlag) throws IOException { + public BuildWithDetails updateDisplayName(String displayName, boolean crumbFlag) throws IOException { Objects.requireNonNull(displayName, "displayName is not allowed to be null."); String description = getDescription() == null ? "" : getDescription(); // TODO: Check what the "core:apply" means? ImmutableMap params = ImmutableMap.of("displayName", displayName, "description", description, "core:apply", "", "Submit", "Save"); client.post_form(this.getUrl() + "/configSubmit?", params, crumbFlag); + return this; } /** @@ -243,8 +245,8 @@ public void updateDisplayName(String displayName, boolean crumbFlag) throws IOEx * @param displayName The new displayName which should be set. * @throws IOException in case of errors. */ - public void updateDisplayName(String displayName) throws IOException { - updateDisplayName(displayName, false); + public BuildWithDetails updateDisplayName(String displayName) throws IOException { + return updateDisplayName(displayName, false); } /** @@ -254,13 +256,14 @@ public void updateDisplayName(String displayName) throws IOException { * @param crumbFlag true or false. * @throws IOException in case of errors. */ - public void updateDescription(String description, boolean crumbFlag) throws IOException { + public BuildWithDetails updateDescription(String description, boolean crumbFlag) throws IOException { Objects.requireNonNull(description, "description is not allowed to be null."); String displayName = getDisplayName() == null ? "" : getDisplayName(); // TODO: Check what the "core:apply" means? ImmutableMap params = ImmutableMap.of("displayName", displayName, "description", description, "core:apply", "", "Submit", "Save"); client.post_form(this.getUrl() + "/configSubmit?", params, crumbFlag); + return this; } /** @@ -269,8 +272,8 @@ public void updateDescription(String description, boolean crumbFlag) throws IOEx * @param description The description which should be set. * @throws IOException in case of errors. */ - public void updateDescription(String description) throws IOException { - updateDescription(description, false); + public BuildWithDetails updateDescription(String description) throws IOException { + return updateDescription(description, false); } private boolean isNullOrEmpty(String value) { @@ -500,8 +503,9 @@ public BuildChangeSet getChangeSet() { return result; } - public void setChangeSet(BuildChangeSet changeSet) { + public BuildWithDetails setChangeSet(BuildChangeSet changeSet) { this.changeSet = changeSet; + return this; } /** @@ -522,20 +526,23 @@ public List getChangeSets() { return result; } - public void setChangeSets(List changeSets) { + public BuildWithDetails setChangeSets(List changeSets) { this.changeSets = changeSets; + return this; } public List getCulprits() { return culprits; } - public void setCulprits(List culprits) { + public BuildWithDetails setCulprits(List culprits) { this.culprits = culprits; + return this; } - public void setResult(BuildResult result) { + public BuildWithDetails setResult(BuildResult result) { this.result = result; + return this; } public InputStream downloadArtifact(Artifact a) throws IOException, URISyntaxException { diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/CauseAction.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/CauseAction.java index e481f03a..dd455b50 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/CauseAction.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/CauseAction.java @@ -9,24 +9,27 @@ public String getShortDescription() { return shortDescription; } - public void setShortDescription(String shortDescription) { + public CauseAction setShortDescription(String shortDescription) { this.shortDescription = shortDescription; + return this; } public String getUserId() { return userId; } - public void setUserId(String userId) { + public CauseAction setUserId(String userId) { this.userId = userId; + return this; } public String getUserName() { return userName; } - public void setUserName(String userName) { + public CauseAction setUserName(String userName) { this.userName = userName; + return this; } @Override diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Computer.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Computer.java index 75f63af9..2414f061 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Computer.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Computer.java @@ -10,6 +10,7 @@ import java.util.List; import com.offbytwo.jenkins.client.util.EncodingUtils; +import com.fasterxml.jackson.annotation.JsonProperty; /** * @author Kelly Plummer @@ -19,17 +20,20 @@ public class Computer extends BaseModel { private String displayName; - public List getComputers() { - return computer; - } + private List computers; - public void setComputer(List computer) { - this.computer = computer; + public Computer() { } - List computer; + @JsonProperty("computer") + public List getComputers() { + return computers; + } - public Computer() { + @JsonProperty("computer") + public Computer setComputers(List computers) { + this.computers = computers; + return this; } public Computer(String displayName) { @@ -65,10 +69,10 @@ public boolean equals(Object obj) { if (getClass() != obj.getClass()) return false; Computer other = (Computer) obj; - if (computer == null) { - if (other.computer != null) + if (computers == null) { + if (other.computers != null) return false; - } else if (!computer.equals(other.computer)) + } else if (!computers.equals(other.computers)) return false; if (displayName == null) { if (other.displayName != null) @@ -82,7 +86,7 @@ public boolean equals(Object obj) { public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + ((computer == null) ? 0 : computer.hashCode()); + result = prime * result + ((computers == null) ? 0 : computers.hashCode()); result = prime * result + ((displayName == null) ? 0 : displayName.hashCode()); return result; } diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ComputerSet.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ComputerSet.java index 7bebc43f..db512285 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ComputerSet.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ComputerSet.java @@ -26,24 +26,27 @@ public int getBusyExecutors() { return busyExecutors; } - public void setBusyExecutors(int busyExecutors) { + public ComputerSet setBusyExecutors(int busyExecutors) { this.busyExecutors = busyExecutors; + return this; } public String getDisplayName() { return displayName; } - public void setDisplayName(String displayName) { + public ComputerSet setDisplayName(String displayName) { this.displayName = displayName; + return this; } public int getTotalExecutors() { return totalExecutors; } - public void setTotalExecutors(int totalExecutors) { + public ComputerSet setTotalExecutors(int totalExecutors) { this.totalExecutors = totalExecutors; + return this; } public List getComputers() { @@ -56,8 +59,9 @@ public ComputerWithDetails apply(ComputerWithDetails computerWithDetails) { }); } - public void setComputer(List computers) { + public ComputerSet setComputer(List computers) { this.computer = computers; + return this; } @Override diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ComputerWithDetails.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ComputerWithDetails.java index 93206009..385d7d36 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ComputerWithDetails.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ComputerWithDetails.java @@ -34,6 +34,7 @@ public class ComputerWithDetails extends Computer { public ComputerWithDetails() { } + @Override public String getDisplayName() { return displayName; } @@ -79,7 +80,7 @@ public LoadStatistics getLoadStatistics() throws IOException { return client.get("/computer/" + name + "/" + "loadStatistics/?depth=2", LoadStatistics.class); } - public void toggleOffline(boolean crumbFlag) throws IOException { + public ComputerWithDetails toggleOffline(boolean crumbFlag) throws IOException { // curl --data "json=init" -X POST "http://192.168.99.100:8080/computer/(master)/toggleOffline" String name; if ("master".equals(displayName)) { @@ -91,27 +92,28 @@ public void toggleOffline(boolean crumbFlag) throws IOException { Map data = new HashMap(); data.put( "json", "init" ); client.post( "/computer/" + name + "/toggleOffline", crumbFlag); + return this; } - public void toggleOffline() throws IOException { - toggleOffline( false ); + public ComputerWithDetails toggleOffline() throws IOException { + return toggleOffline(false); } - public void changeOfflineCause(String cause, boolean crumbFlag) throws IOException { + public ComputerWithDetails changeOfflineCause(String cause, boolean crumbFlag) throws IOException { String name; if ("master".equals(displayName)) { name = "(master)"; } else { name = EncodingUtils.encode(displayName); } - - Map data = new HashMap(); - data.put( "offlineMessage", cause ); - client.post_form("/computer/" + name + "/changeOfflineCause?", data, crumbFlag); + Map data = new HashMap(); + data.put("offlineMessage", cause); + client.post_form("/computer/" + name + "/changeOfflineCause?", data, crumbFlag); + return this; } - public void changeOfflineCause(String cause) throws IOException { - changeOfflineCause(cause, false); + public ComputerWithDetails changeOfflineCause(String cause) throws IOException { + return changeOfflineCause(cause, false); } public Boolean getManualLaunchAllowed() { diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ConsoleLog.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ConsoleLog.java index 59ef5c6d..503e1ce0 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ConsoleLog.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ConsoleLog.java @@ -19,23 +19,26 @@ public String getConsoleLog() { return consoleLog; } - public void setConsoleLog(String consoleLog) { + public ConsoleLog setConsoleLog(String consoleLog) { this.consoleLog = consoleLog; + return this; } public Boolean getHasMoreData() { return hasMoreData; } - public void setHasMoreData(Boolean hasMoreData) { + public ConsoleLog setHasMoreData(Boolean hasMoreData) { this.hasMoreData = hasMoreData; + return this; } public Integer getCurrentBufferSize() { return currentBufferSize; } - public void setCurrentBufferSize(Integer currentBufferSize) { + public ConsoleLog setCurrentBufferSize(Integer currentBufferSize) { this.currentBufferSize = currentBufferSize; + return this; } } diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Executable.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Executable.java index ff1b6e27..5f044e13 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Executable.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Executable.java @@ -9,16 +9,18 @@ public Long getNumber() { return number; } - public void setNumber(Long number) { + public Executable setNumber(Long number) { this.number = number; + return this; } public String getUrl() { return url; } - public void setUrl(String url) { + public Executable setUrl(String url) { this.url = url; + return this; } @Override diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Executor.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Executor.java index 15fcebde..c6914d97 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Executor.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Executor.java @@ -23,48 +23,54 @@ public Job getCurrentExecutable() { return currentExecutable; } - public void setCurrentExecutable(Job currentExecutable) { + public Executor setCurrentExecutable(Job currentExecutable) { this.currentExecutable = currentExecutable; + return this; } public Job getCurrentWorkUnit() { return currentWorkUnit; } - public void setCurrentWorkUnit(Job currentWorkUnit) { + public Executor setCurrentWorkUnit(Job currentWorkUnit) { this.currentWorkUnit = currentWorkUnit; + return this; } public Boolean getIdle() { return idle; } - public void setIdle(Boolean idle) { + public Executor setIdle(Boolean idle) { this.idle = idle; + return this; } public Boolean getLikelyStuck() { return likelyStuck; } - public void setLikelyStuck(Boolean likelyStuck) { + public Executor setLikelyStuck(Boolean likelyStuck) { this.likelyStuck = likelyStuck; + return this; } public int getNumber() { return number; } - public void setNumber(int number) { + public Executor setNumber(int number) { this.number = number; + return this; } public int getProgress() { return progress; } - public void setProgress(int progress) { + public Executor setProgress(int progress) { this.progress = progress; + return this; } @Override diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ExtractHeader.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ExtractHeader.java index cb3c683a..6dd43221 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ExtractHeader.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ExtractHeader.java @@ -4,8 +4,9 @@ public class ExtractHeader extends BaseModel { private String location; - public void setLocation(String value) { + public ExtractHeader setLocation(String value) { location = value; + return this; } public String getLocation() { diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/FolderJob.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/FolderJob.java index 25a26770..d6494633 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/FolderJob.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/FolderJob.java @@ -80,8 +80,8 @@ public String apply(Job job) { * @param folderName name of the folder to be created. * @throws IOException in case of an error. */ - public void createFolder(String folderName) throws IOException { - createFolder(folderName, false); + public FolderJob createFolder(String folderName) throws IOException { + return createFolder(folderName, false); } /** @@ -89,14 +89,16 @@ public void createFolder(String folderName) throws IOException { * * @param folderName name of the folder to be created. * @param crumbFlag true/false. + * @return * @throws IOException in case of an error. */ - public void createFolder(String folderName, Boolean crumbFlag) throws IOException { + public FolderJob createFolder(String folderName, Boolean crumbFlag) throws IOException { // https://gist.github.com/stuart-warren/7786892 was slightly helpful // here ImmutableMap params = ImmutableMap.of("mode", "com.cloudbees.hudson.plugins.folder.Folder", "name", EncodingUtils.formParameter(folderName), "from", "", "Submit", "OK"); client.post_form(this.getUrl() + "/createItem?", params, crumbFlag); + return this; } /* diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/HourMinSec10.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/HourMinSec10.java index 0dba01dc..66823616 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/HourMinSec10.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/HourMinSec10.java @@ -15,24 +15,27 @@ public Statis getHour() { return hour; } - public void setHour(Statis hour) { + public HourMinSec10 setHour(Statis hour) { this.hour = hour; + return this; } public Statis getMin() { return min; } - public void setMin(Statis min) { + public HourMinSec10 setMin(Statis min) { this.min = min; + return this; } public Statis getSec10() { return sec10; } - public void setSec10(Statis sec10) { + public HourMinSec10 setSec10(Statis sec10) { this.sec10 = sec10; + return this; } @Override diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/JacocoCoverageReport.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/JacocoCoverageReport.java index ed623aa1..cc1345d5 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/JacocoCoverageReport.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/JacocoCoverageReport.java @@ -11,32 +11,46 @@ public class JacocoCoverageReport extends BaseModel { public JacocoCoverageResult getLineCoverage() { return lineCoverage; } - public void setLineCoverage(JacocoCoverageResult lineCoverage) { + + public JacocoCoverageReport setLineCoverage(JacocoCoverageResult lineCoverage) { this.lineCoverage = lineCoverage; + return this; } + public JacocoCoverageResult getClassCoverage() { return classCoverage; } - public void setClassCoverage(JacocoCoverageResult classCoverage) { + + public JacocoCoverageReport setClassCoverage(JacocoCoverageResult classCoverage) { this.classCoverage = classCoverage; + return this; } + public JacocoCoverageResult getComplexityScore() { return complexityScore; } - public void setComplexityScore(JacocoCoverageResult complexityScore) { + + public JacocoCoverageReport setComplexityScore(JacocoCoverageResult complexityScore) { this.complexityScore = complexityScore; + return this; } + public JacocoCoverageResult getInstructionCoverage() { return instructionCoverage; } - public void setInstructionCoverage(JacocoCoverageResult instructionCoverage) { + + public JacocoCoverageReport setInstructionCoverage(JacocoCoverageResult instructionCoverage) { this.instructionCoverage = instructionCoverage; + return this; } + public JacocoCoverageResult getBranchCoverage() { return branchCoverage; } - public void setBranchCoverage(JacocoCoverageResult branchCoverage) { + + public JacocoCoverageReport setBranchCoverage(JacocoCoverageResult branchCoverage) { this.branchCoverage = branchCoverage; + return this; } } \ No newline at end of file diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/JacocoCoverageResult.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/JacocoCoverageResult.java index 760bb610..41f3f43d 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/JacocoCoverageResult.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/JacocoCoverageResult.java @@ -11,34 +11,46 @@ public class JacocoCoverageResult { public int getCovered() { return covered; } - public void setCovered(int covered) { + + public JacocoCoverageResult setCovered(int covered) { this.covered = covered; + return this; } + public int getMissed() { return missed; } - public void setMissed(int missed) { + + public JacocoCoverageResult setMissed(int missed) { this.missed = missed; + return this; } + public int getPercentage() { return percentage; } - public void setPercentage(int percentage) { + + public JacocoCoverageResult setPercentage(int percentage) { this.percentage = percentage; + return this; } + public int getPercentageFloat() { return percentageFloat; } - public void setPercentageFloat(int percentageFloat) { + + public JacocoCoverageResult setPercentageFloat(int percentageFloat) { this.percentageFloat = percentageFloat; + return this; } + public int getTotal() { return total; } - public void setTotal(int total) { + + public JacocoCoverageResult setTotal(int total) { this.total = total; + return this; } - - } \ No newline at end of file diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/JobConfiguration.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/JobConfiguration.java index 571430ab..d6a95050 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/JobConfiguration.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/JobConfiguration.java @@ -77,7 +77,8 @@ public String getConfigXml() { return configXml; } - public void setConfigXml(String configXml) { + public JobConfiguration setConfigXml(String configXml) { this.configXml = configXml; + return this; } } diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/JobWithDetails.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/JobWithDetails.java index d203aad5..f723a2f1 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/JobWithDetails.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/JobWithDetails.java @@ -492,8 +492,8 @@ public Job apply(Job job) { * {@link #EMPTY_DESCRIPTION}. * @throws IOException in case of errors. */ - public void updateDescription(String description) throws IOException { - updateDescription(description, false); + public JobWithDetails updateDescription(String description) throws IOException { + return updateDescription(description, false); } /** @@ -505,10 +505,11 @@ public void updateDescription(String description) throws IOException { * @param crumbFlag true or false. * @throws IOException in case of errors. */ - public void updateDescription(String description, boolean crumbFlag) throws IOException { + public JobWithDetails updateDescription(String description, boolean crumbFlag) throws IOException { Objects.requireNonNull(description, "description is not allowed to be null."); ImmutableMap params = ImmutableMap.of("description", description); client.post_form(this.getUrl() + "/submitDescription?", params, crumbFlag); + return this; } /** @@ -516,8 +517,8 @@ public void updateDescription(String description, boolean crumbFlag) throws IOEx * * @throws IOException in case of errors. */ - public void clearDescription() throws IOException { - updateDescription(EMPTY_DESCRIPTION); + public JobWithDetails clearDescription() throws IOException { + return updateDescription(EMPTY_DESCRIPTION); } /** @@ -526,8 +527,8 @@ public void clearDescription() throws IOException { * @param crumbFlag true or false. * @throws IOException in case of errors. */ - public void clearDescription(boolean crumbFlag) throws IOException { - updateDescription(EMPTY_DESCRIPTION, crumbFlag); + public JobWithDetails clearDescription(boolean crumbFlag) throws IOException { + return updateDescription(EMPTY_DESCRIPTION, crumbFlag); } @Override diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/LoadStatistics.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/LoadStatistics.java index df2a5608..fc335e5e 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/LoadStatistics.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/LoadStatistics.java @@ -18,24 +18,27 @@ public HourMinSec10 getBusyExecutors() { return busyExecutors; } - public void setBusyExecutors(HourMinSec10 busyExecutors) { + public LoadStatistics setBusyExecutors(HourMinSec10 busyExecutors) { this.busyExecutors = busyExecutors; + return this; } public HourMinSec10 getQueueLength() { return queueLength; } - public void setQueueLength(HourMinSec10 queueLength) { + public LoadStatistics setQueueLength(HourMinSec10 queueLength) { this.queueLength = queueLength; + return this; } public HourMinSec10 getTotalExecutors() { return totalExecutors; } - public void setTotalExecutors(HourMinSec10 totalExecutors) { + public LoadStatistics setTotalExecutors(HourMinSec10 totalExecutors) { this.totalExecutors = totalExecutors; + return this; } @Override diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/MainView.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/MainView.java index b239558d..b856f981 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/MainView.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/MainView.java @@ -34,15 +34,17 @@ public List getJobs() { return jobs; } - public void setJobs(List jobs) { + public MainView setJobs(List jobs) { this.jobs = jobs; + return this; } public List getViews() { return views; } - public void setViews(List views) { + public MainView setViews(List views) { this.views = views; + return this; } } diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/MavenArtifact.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/MavenArtifact.java index 184ccc37..c51ea4ea 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/MavenArtifact.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/MavenArtifact.java @@ -18,63 +18,71 @@ public String getArtifactId() { return artifactId; } - public void setArtifactId(String artifactId) { + public MavenArtifact setArtifactId(String artifactId) { this.artifactId = artifactId; + return this; } public String getCanonicalName() { return canonicalName; } - public void setCanonicalName(String canonicalName) { + public MavenArtifact setCanonicalName(String canonicalName) { this.canonicalName = canonicalName; + return this; } public String getClassifier() { return classifier; } - public void setClassifier(String classifier) { + public MavenArtifact setClassifier(String classifier) { this.classifier = classifier; + return this; } public String getFileName() { return fileName; } - public void setFileName(String fileName) { + public MavenArtifact setFileName(String fileName) { this.fileName = fileName; + return this; } public String getGroupId() { return groupId; } - public void setGroupId(String groupId) { + public MavenArtifact setGroupId(String groupId) { this.groupId = groupId; + return this; } public String getMd5sum() { return md5sum; } - public void setMd5sum(String md5sum) { + public MavenArtifact setMd5sum(String md5sum) { this.md5sum = md5sum; + return this; } public String getType() { return type; } - public void setType(String type) { + public MavenArtifact setType(String type) { this.type = type; + return this; } public String getVersion() { return version; } - public void setVersion(String version) { + public MavenArtifact setVersion(String version) { this.version = version; + return this; } } diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/MavenModuleRecord.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/MavenModuleRecord.java index 3684c21d..34fbd424 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/MavenModuleRecord.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/MavenModuleRecord.java @@ -17,39 +17,44 @@ public List getAttachedArtifacts() { return attachedArtifacts; } - public void setAttachedArtifacts(List attachedArtifacts) { + public MavenModuleRecord setAttachedArtifacts(List attachedArtifacts) { this.attachedArtifacts = attachedArtifacts; + return this; } public Build getParent() { return parent; } - public void setParent(Build parent) { + public MavenModuleRecord setParent(Build parent) { this.parent = parent; + return this; } public MavenArtifact getMainArtifact() { return mainArtifact; } - public void setMainArtifact(MavenArtifact mainArtifact) { + public MavenModuleRecord setMainArtifact(MavenArtifact mainArtifact) { this.mainArtifact = mainArtifact; + return this; } public MavenArtifact getPomArtifact() { return pomArtifact; } - public void setPomArtifact(MavenArtifact pomArtifact) { + public MavenModuleRecord setPomArtifact(MavenArtifact pomArtifact) { this.pomArtifact = pomArtifact; + return this; } public String getUrl() { return url; } - public void setUrl(String url) { + public MavenModuleRecord setUrl(String url) { this.url = url; + return this; } } diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/OfflineCause.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/OfflineCause.java index 66c70cd1..30969dc9 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/OfflineCause.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/OfflineCause.java @@ -17,6 +17,16 @@ public String getDescription() { return description; } + public OfflineCause setTimestamp(Long timestamp) { + this.timestamp = timestamp; + return this; + } + + public OfflineCause setDescription(String description) { + this.description = description; + return this; + } + @Override public int hashCode() { final int prime = 31; @@ -48,12 +58,4 @@ public boolean equals(Object obj) { return true; } - public void setTimestamp(Long timestamp) { - this.timestamp = timestamp; - } - - public void setDescription(String description) { - this.description = description; - } - } diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ParameterDefinitions.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ParameterDefinitions.java index b46c69e4..47247c74 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ParameterDefinitions.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ParameterDefinitions.java @@ -30,11 +30,13 @@ public List getStringParams() { return stringParams; } - public void setStringParams(List stringParams) { + public ParameterDefinitions setStringParams(List stringParams) { this.stringParams = stringParams; + return this; } - public void addParam(StringParameterDefinition spd) { + public ParameterDefinitions addParam(StringParameterDefinition spd) { stringParams.add(spd); + return this; } } diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ParametersDefinitionProperty.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ParametersDefinitionProperty.java index efb033f5..bb88a128 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ParametersDefinitionProperty.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/ParametersDefinitionProperty.java @@ -26,7 +26,8 @@ public ParameterDefinitions getPd() { return pd; } - public void setPd(ParameterDefinitions pd) { + public ParametersDefinitionProperty setPd(ParameterDefinitions pd) { this.pd = pd; + return this; } } diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Plugin.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Plugin.java index fe380202..6c9e09a1 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Plugin.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Plugin.java @@ -27,9 +27,10 @@ public boolean isActive() return active; } - public void setActive( boolean active ) + public Plugin setActive(boolean active) { this.active = active; + return this; } public String getBackupVersion() @@ -37,9 +38,10 @@ public String getBackupVersion() return backupVersion; } - public void setBackupVersion( String backupVersion ) + public Plugin setBackupVersion(String backupVersion) { this.backupVersion = backupVersion; + return this; } public boolean isBundled() @@ -47,9 +49,10 @@ public boolean isBundled() return bundled; } - public void setBundled( boolean bundled ) + public Plugin setBundled(boolean bundled) { this.bundled = bundled; + return this; } public boolean isDowngradable() @@ -57,9 +60,10 @@ public boolean isDowngradable() return downgradable; } - public void setDowngradable( boolean downgradable ) + public Plugin setDowngradable(boolean downgradable) { this.downgradable = downgradable; + return this; } public boolean isEnabled() @@ -67,9 +71,10 @@ public boolean isEnabled() return enabled; } - public void setEnabled( boolean enabled ) + public Plugin setEnabled(boolean enabled) { this.enabled = enabled; + return this; } public boolean isHasUpdate() @@ -77,9 +82,10 @@ public boolean isHasUpdate() return hasUpdate; } - public void setHasUpdate( boolean hasUpdate ) + public Plugin setHasUpdate(boolean hasUpdate) { this.hasUpdate = hasUpdate; + return this; } public String getLongName() @@ -87,9 +93,10 @@ public String getLongName() return longName; } - public void setLongName( String longName ) + public Plugin setLongName(String longName) { this.longName = longName; + return this; } public boolean isPinned() @@ -97,9 +104,10 @@ public boolean isPinned() return pinned; } - public void setPinned( boolean pinned ) + public Plugin setPinned(boolean pinned) { this.pinned = pinned; + return this; } public String getShortName() @@ -107,9 +115,10 @@ public String getShortName() return shortName; } - public void setShortName( String shortName ) + public Plugin setShortName(String shortName) { this.shortName = shortName; + return this; } public String getSupportsDynamicLoad() @@ -117,9 +126,10 @@ public String getSupportsDynamicLoad() return supportsDynamicLoad; } - public void setSupportsDynamicLoad( String supportsDynamicLoad ) + public Plugin setSupportsDynamicLoad(String supportsDynamicLoad) { this.supportsDynamicLoad = supportsDynamicLoad; + return this; } public String getUrl() @@ -127,9 +137,10 @@ public String getUrl() return url; } - public void setUrl( String url ) + public Plugin setUrl(String url) { this.url = url; + return this; } public String getVersion() @@ -137,9 +148,10 @@ public String getVersion() return version; } - public void setVersion( String version ) + public Plugin setVersion(String version) { this.version = version; + return this; } public List getDependencies() @@ -147,9 +159,10 @@ public List getDependencies() return dependencies; } - public void setDependencies( List dependencies ) + public Plugin setDependencies(List dependencies) { this.dependencies = dependencies; + return this; } @Override @@ -247,6 +260,4 @@ else if ( !version.equals( other.version ) ) return true; } - - } diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/PluginDependency.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/PluginDependency.java index adb1331d..acac798d 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/PluginDependency.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/PluginDependency.java @@ -11,6 +11,33 @@ public class PluginDependency extends BaseModel private String version; + public boolean isOptional() { + return optional; + } + + public PluginDependency setOptional(boolean optional) { + this.optional = optional; + return this; + } + + public String getShortName() { + return shortName; + } + + public PluginDependency setShortName(String shortName) { + this.shortName = shortName; + return this; + } + + public String getVersion() { + return version; + } + + public PluginDependency setVersion(String version) { + this.version = version; + return this; + } + @Override public int hashCode() { @@ -51,34 +78,4 @@ else if ( !version.equals( other.version ) ) return true; } - public boolean isOptional() - { - return optional; - } - - public void setOptional( boolean optional ) - { - this.optional = optional; - } - - public String getShortName() - { - return shortName; - } - - public void setShortName( String shortName ) - { - this.shortName = shortName; - } - - public String getVersion() - { - return version; - } - - public void setVersion( String version ) - { - this.version = version; - } - } diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/PluginManager.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/PluginManager.java index f23ccaba..c08fc713 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/PluginManager.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/PluginManager.java @@ -14,8 +14,9 @@ public List getPlugins() return plugins; } - public void setPlugins(List plugins) { + public PluginManager setPlugins(List plugins) { this.plugins = plugins; + return this; } @Override diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Queue.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Queue.java index 3320ecb5..355dc910 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Queue.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Queue.java @@ -8,8 +8,7 @@ import java.util.List; -public class Queue - extends BaseModel +public class Queue extends BaseModel { private List discoverableItems; @@ -24,9 +23,10 @@ public List getDiscoverableItems() return discoverableItems; } - public void setDiscoverableItems( List discoverableItems ) + public Queue setDiscoverableItems(List discoverableItems) { this.discoverableItems = discoverableItems; + return this; } @Override @@ -44,9 +44,10 @@ public List getItems() return items; } - public void setItems( List items ) + public Queue setItems(List items) { this.items = items; + return this; } @Override diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/QueueItem.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/QueueItem.java index 662b3e2b..ae2d8d3d 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/QueueItem.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/QueueItem.java @@ -38,48 +38,54 @@ public List getActions() { return actions; } - public void setActions(List actions) { + public QueueItem setActions(List actions) { this.actions = actions; + return this; } public boolean isBlocked() { return blocked; } - public void setBlocked(boolean blocked) { + public QueueItem setBlocked(boolean blocked) { this.blocked = blocked; + return this; } public boolean isBuildable() { return buildable; } - public void setBuildable(boolean buildable) { + public QueueItem setBuildable(boolean buildable) { this.buildable = buildable; + return this; } public Long getId() { return id; } - public void setId(Long id) { + public QueueItem setId(Long id) { this.id = id; + return this; } public Long getInQueueSince() { return inQueueSince; } - public void setInQueueSince(Long inQueueSince) { + public QueueItem setInQueueSince(Long inQueueSince) { this.inQueueSince = inQueueSince; + return this; } public String getParams() { return params; } - public void setParams(String params) { + public QueueItem setParams(String params) { this.params = params; + return this; } public boolean isStuck() { @@ -90,44 +96,50 @@ public QueueTask getTask() { return task; } - public void setTask(QueueTask task) { + public QueueItem setTask(QueueTask task) { this.task = task; + return this; } - public void setStuck(boolean stuck) { + public QueueItem setStuck(boolean stuck) { this.stuck = stuck; + return this; } public String getUrl() { return url; } - public void setUrl(String url) { + public QueueItem setUrl(String url) { this.url = url; + return this; } public String getWhy() { return why; } - public void setWhy(String why) { + public QueueItem setWhy(String why) { this.why = why; + return this; } public boolean isCancelled() { return cancelled; } - public void setCancelled(boolean cancelled) { + public QueueItem setCancelled(boolean cancelled) { this.cancelled = cancelled; + return this; } public Executable getExecutable() { return executable; } - public void setExecutable(Executable executable) { + public QueueItem setExecutable(Executable executable) { this.executable = executable; + return this; } @Override diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/QueueItemActions.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/QueueItemActions.java index 4c49ba5f..cbd6e390 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/QueueItemActions.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/QueueItemActions.java @@ -15,8 +15,9 @@ public List getCauses() { return causes; } - public void setCauses(List causes) { + public QueueItemActions setCauses(List causes) { this.causes = causes; + return this; } } diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Statis.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Statis.java index b2c601c3..bb920ea4 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Statis.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Statis.java @@ -22,16 +22,18 @@ public List getHistory() { return history; } - public void setHistory(List history) { + public Statis setHistory(List history) { this.history = history; + return this; } public Double getLatest() { return latest; } - public void setLatest(Double latest) { + public Statis setLatest(Double latest) { this.latest = latest; + return this; } @Override diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/StringParameterDefinition.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/StringParameterDefinition.java index 740e3d77..2a89618f 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/StringParameterDefinition.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/StringParameterDefinition.java @@ -34,23 +34,26 @@ public String getName() { return name; } - public void setName(String name) { + public StringParameterDefinition setName(String name) { this.name = name; + return this; } public String getDescription() { return description; } - public void setDescription(String description) { + public StringParameterDefinition setDescription(String description) { this.description = description; + return this; } public String getDefaultValue() { return defaultValue; } - public void setDefaultValue(String defaultValue) { + public StringParameterDefinition setDefaultValue(String defaultValue) { this.defaultValue = defaultValue; + return this; } } diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestCase.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestCase.java index 8f4f3795..f3ac1331 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestCase.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestCase.java @@ -21,9 +21,10 @@ public int getAge() return age; } - public void setAge( int age ) + public TestCase setAge(int age) { this.age = age; + return this; } public String getClassName() @@ -31,9 +32,10 @@ public String getClassName() return className; } - public void setClassName( String className ) + public TestCase setClassName(String className) { this.className = className; + return this; } public double getDuration() @@ -41,9 +43,10 @@ public double getDuration() return duration; } - public void setDuration( double duration ) + public TestCase setDuration(double duration) { this.duration = duration; + return this; } public int getFailedSince() @@ -51,9 +54,10 @@ public int getFailedSince() return failedSince; } - public void setFailedSince( int failedSince ) + public TestCase setFailedSince(int failedSince) { this.failedSince = failedSince; + return this; } public String getName() @@ -61,9 +65,10 @@ public String getName() return name; } - public void setName( String name ) + public TestCase setName(String name) { this.name = name; + return this; } public boolean isSkipped() @@ -71,9 +76,10 @@ public boolean isSkipped() return skipped; } - public void setSkipped( boolean skipped ) + public TestCase setSkipped(boolean skipped) { this.skipped = skipped; + return this; } public String getStatus() @@ -81,9 +87,10 @@ public String getStatus() return status; } - public void setStatus( String status ) + public TestCase setStatus(String status) { this.status = status; + return this; } public String getErrorDetails() @@ -91,9 +98,10 @@ public String getErrorDetails() return errorDetails; } - public void setErrorDetails( String errorDetails ) + public TestCase setErrorDetails(String errorDetails) { this.errorDetails = errorDetails; + return this; } public String getErrorStackTrace() @@ -101,9 +109,10 @@ public String getErrorStackTrace() return errorStackTrace; } - public void setErrorStackTrace( String errorStackTrace ) + public TestCase setErrorStackTrace(String errorStackTrace) { this.errorStackTrace = errorStackTrace; + return this; } @Override diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestChild.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestChild.java index 516bb446..a8d50ca0 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestChild.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestChild.java @@ -12,16 +12,18 @@ public int getNumber() { return number; } - public void setNumber(int number) { + public TestChild setNumber(int number) { this.number = number; + return this; } public String getUrl() { return url; } - public void setUrl(String url) { + public TestChild setUrl(String url) { this.url = url; + return this; } @Override diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestChildReport.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestChildReport.java index da920bec..7d3ea3f5 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestChildReport.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestChildReport.java @@ -13,8 +13,18 @@ public TestChild getChild() { return child; } - public void setChild(TestChild child) { + public TestChildReport setChild(TestChild child) { this.child = child; + return this; + } + + public TestResult getResult() { + return result; + } + + public TestChildReport setResult(TestResult result) { + this.result = result; + return this; } @Override @@ -48,12 +58,4 @@ public boolean equals(Object obj) { return true; } - public TestResult getResult() { - return result; - } - - public void setResult(TestResult result) { - this.result = result; - } - } diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestReport.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestReport.java index b775c3f2..de3f0162 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestReport.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestReport.java @@ -47,40 +47,45 @@ public int getFailCount() { return failCount; } - public void setFailCount(int failCount) { + public TestReport setFailCount(int failCount) { this.failCount = failCount; + return this; } public int getSkipCount() { return skipCount; } - public void setSkipCount(int skipCount) { + public TestReport setSkipCount(int skipCount) { this.skipCount = skipCount; + return this; } public int getTotalCount() { return totalCount; } - public void setTotalCount(int totalCount) { + public TestReport setTotalCount(int totalCount) { this.totalCount = totalCount; + return this; } public String getUrlName() { return urlName; } - public void setUrlName(String urlName) { + public TestReport setUrlName(String urlName) { this.urlName = urlName; + return this; } public List getChildReports() { return childReports; } - public void setChildReports(List childReports) { + public TestReport setChildReports(List childReports) { this.childReports = childReports; + return this; } @Override diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestResult.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestResult.java index 934b32d4..5dda306f 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestResult.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestResult.java @@ -20,40 +20,54 @@ public double getDuration() { return duration; } - public void setDuration(double duration) { + public TestResult setDuration(double duration) { this.duration = duration; + return this; } public boolean isEmpty() { return empty; } - public void setEmpty(boolean empty) { + public TestResult setEmpty(boolean empty) { this.empty = empty; + return this; } public int getFailCount() { return failCount; } - public void setFailCount(int failCount) { + public TestResult setFailCount(int failCount) { this.failCount = failCount; + return this; } public int getPassCount() { return passCount; } - public void setPassCount(int passCount) { + public TestResult setPassCount(int passCount) { this.passCount = passCount; + return this; } public int getSkipCount() { return skipCount; } - public void setSkipCount(int skipCount) { + public TestResult setSkipCount(int skipCount) { this.skipCount = skipCount; + return this; + } + + public List getSuites() { + return suites; + } + + public TestResult setSuites(List suites) { + this.suites = suites; + return this; } @Override @@ -97,12 +111,4 @@ public boolean equals(Object obj) { return false; return true; } - - public List getSuites() { - return suites; - } - - public void setSuites(List suites) { - this.suites = suites; - } } diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestSuites.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestSuites.java index 45c96883..030b03b9 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestSuites.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/TestSuites.java @@ -19,40 +19,45 @@ public double getDuration() { return duration; } - public void setDuration(double duration) { + public TestSuites setDuration(double duration) { this.duration = duration; + return this; } public String getId() { return id; } - public void setId(String id) { + public TestSuites setId(String id) { this.id = id; + return this; } public String getName() { return name; } - public void setName(String name) { + public TestSuites setName(String name) { this.name = name; + return this; } public String getTimestamp() { return timestamp; } - public void setTimestamp(String timestamp) { + public TestSuites setTimestamp(String timestamp) { this.timestamp = timestamp; + return this; } public List getCases() { return cases; } - public void setCases(List cases) { + public TestSuites setCases(List cases) { this.cases = cases; + return this; } @Override diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/View.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/View.java index 5267e4f1..422cd5a4 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/View.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/View.java @@ -13,8 +13,9 @@ public String getName() { return name; } - public void setName(String name) { + public View setName(String name) { this.name = name; + return this; } public View() { @@ -24,16 +25,18 @@ public String getDescription() { return description; } - public void setDescription(String description) { + public View setDescription(String description) { this.description = description; + return this; } public String getUrl() { return url; } - public void setUrl(String url) { + public View setUrl(String url) { this.url = url; + return this; } @Override