Skip to content

Commit 0f1a8bc

Browse files
mivolakhmarbaise
authored andcommitted
fixes #360 by changing the return value from void to the appropriate object (#403)
1 parent a5a59ca commit 0f1a8bc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+506
-309
lines changed

jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java

Lines changed: 80 additions & 59 deletions
Large diffs are not rendered by default.

jenkins-client/src/main/java/com/offbytwo/jenkins/model/Artifact.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,27 @@ public String getDisplayPath() {
1616
return displayPath;
1717
}
1818

19-
public void setDisplayPath(String displayPath) {
19+
public Artifact setDisplayPath(String displayPath) {
2020
this.displayPath = displayPath;
21+
return this;
2122
}
2223

2324
public String getFileName() {
2425
return fileName;
2526
}
2627

27-
public void setFileName(String fileName) {
28+
public Artifact setFileName(String fileName) {
2829
this.fileName = fileName;
30+
return this;
2931
}
3032

3133
public String getRelativePath() {
3234
return relativePath;
3335
}
3436

35-
public void setRelativePath(String relativePath) {
37+
public Artifact setRelativePath(String relativePath) {
3638
this.relativePath = relativePath;
39+
return this;
3740
}
3841

3942
@Override

jenkins-client/src/main/java/com/offbytwo/jenkins/model/BaseModel.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ public JenkinsHttpConnection getClient() {
4343
* Set the HTTP client.
4444
* @param client {@link JenkinsHttpConnection}.
4545
*/
46-
public void setClient(final JenkinsHttpConnection client) {
46+
public BaseModel setClient(final JenkinsHttpConnection client) {
4747
this.client = client;
48+
return this;
4849
}
4950
}

jenkins-client/src/main/java/com/offbytwo/jenkins/model/Build.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,19 @@ public String getUrl() {
8383
return url;
8484
}
8585

86-
protected void setNumber(int number) {
86+
protected Build setNumber(int number) {
8787
this.number = number;
88+
return this;
8889
}
8990

90-
protected void setQueueId(int queueId) {
91+
protected Build setQueueId(int queueId) {
9192
this.queueId = queueId;
93+
return this;
9294
}
9395

94-
protected void setUrl(String url) {
96+
protected Build setUrl(String url) {
9597
this.url = url;
98+
return this;
9699
}
97100

98101
/**

jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildCause.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,48 +29,54 @@ public String getShortDescription() {
2929
return shortDescription;
3030
}
3131

32-
public void setShortDescription(String shortDescription) {
32+
public BuildCause setShortDescription(String shortDescription) {
3333
this.shortDescription = shortDescription;
34+
return this;
3435
}
3536

3637
public int getUpstreamBuild() {
3738
return upstreamBuild;
3839
}
3940

40-
public void setUpstreamBuild(Integer upstreamBuild) {
41+
public BuildCause setUpstreamBuild(Integer upstreamBuild) {
4142
this.upstreamBuild = upstreamBuild;
43+
return this;
4244
}
4345

4446
public String getUpstreamProject() {
4547
return upstreamProject;
4648
}
4749

48-
public void setUpstreamProject(String upstreamProject) {
50+
public BuildCause setUpstreamProject(String upstreamProject) {
4951
this.upstreamProject = upstreamProject;
52+
return this;
5053
}
5154

5255
public String getUpstreamUrl() {
5356
return upstreamUrl;
5457
}
5558

56-
public void setUpstreamUrl(String upstreamUrl) {
59+
public BuildCause setUpstreamUrl(String upstreamUrl) {
5760
this.upstreamUrl = upstreamUrl;
61+
return this;
5862
}
5963

6064
public String getUserId() {
6165
return userId;
6266
}
6367

64-
public void setUserId(String userId) {
68+
public BuildCause setUserId(String userId) {
6569
this.userId = userId;
70+
return this;
6671
}
6772

6873
public String getUserName() {
6974
return userName;
7075
}
7176

72-
public void setUserName(String userName) {
77+
public BuildCause setUserName(String userName) {
7378
this.userName = userName;
79+
return this;
7480
}
7581

7682
@Override

jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildChangeSet.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ public class BuildChangeSet {
2424
/**
2525
* @param items {@link BuildChangeSet}
2626
*/
27-
public void setItems(List<BuildChangeSetItem> items) {
27+
public BuildChangeSet setItems(List<BuildChangeSetItem> items) {
2828
this.items = items;
29+
return this;
2930
}
3031

3132
/**
@@ -45,8 +46,9 @@ public String getKind() {
4546
/**
4647
* @param kind the kind of (usually svn, git).
4748
*/
48-
public void setKind(String kind) {
49+
public BuildChangeSet setKind(String kind) {
4950
this.kind = kind;
51+
return this;
5052
}
5153

5254
@Override

jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildChangeSetAuthor.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,18 @@ public String getAbsoluteUrl() {
1313
return absoluteUrl;
1414
}
1515

16-
public void setAbsoluteUrl(String absoluteUrl) {
16+
public BuildChangeSetAuthor setAbsoluteUrl(String absoluteUrl) {
1717
this.absoluteUrl = absoluteUrl;
18+
return this;
1819
}
1920

2021
public String getFullName() {
2122
return fullName;
2223
}
2324

24-
public void setFullName(String fullName) {
25+
public BuildChangeSetAuthor setFullName(String fullName) {
2526
this.fullName = fullName;
27+
return this;
2628
}
2729

2830
@Override

jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildChangeSetItem.java

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,72 +27,81 @@ public List<String> getAffectedPaths() {
2727
return affectedPaths;
2828
}
2929

30-
public void setAffectedPaths(List<String> affectedPaths) {
30+
public BuildChangeSetItem setAffectedPaths(List<String> affectedPaths) {
3131
this.affectedPaths = affectedPaths;
32+
return this;
3233
}
3334

3435
public String getCommitId() {
3536
return commitId;
3637
}
3738

38-
public void setCommitId(String commitId) {
39+
public BuildChangeSetItem setCommitId(String commitId) {
3940
this.commitId = commitId;
41+
return this;
4042
}
4143

4244
public String getTimestamp() {
4345
return timestamp;
4446
}
4547

46-
public void setTimestamp(String timeStamp) {
48+
public BuildChangeSetItem setTimestamp(String timeStamp) {
4749
this.timestamp = timeStamp;
50+
return this;
4851
}
4952

5053
public String getComment() {
5154
return comment;
5255
}
5356

54-
public void setComment(String comment) {
57+
public BuildChangeSetItem setComment(String comment) {
5558
this.comment = comment;
59+
return this;
5660
}
5761

5862
public String getDate() {
5963
return date;
6064
}
6165

62-
public void setDate(String date) {
66+
public BuildChangeSetItem setDate(String date) {
6367
this.date = date;
68+
return this;
6469
}
6570

6671
public String getId() {
6772
return id;
6873
}
6974

70-
public void setId(String id) {
75+
public BuildChangeSetItem setId(String id) {
7176
this.id = id;
77+
return this;
7278
}
7379

7480
public String getMsg() {
7581
return msg;
7682
}
7783

78-
public void setMsg(String msg) {
84+
public BuildChangeSetItem setMsg(String msg) {
7985
this.msg = msg;
86+
return this;
8087
}
8188

8289
public List<BuildChangeSetPath> getPaths() {
8390
return paths;
8491
}
8592

86-
public void setPaths(List<BuildChangeSetPath> paths) {
93+
public BuildChangeSetItem setPaths(List<BuildChangeSetPath> paths) {
8794
this.paths = paths;
95+
return this;
8896
}
8997

9098
public BuildChangeSetAuthor getAuthor() {
9199
return author;
92100
}
93101

94-
public void setAuthor(BuildChangeSetAuthor author) {
102+
public BuildChangeSetItem setAuthor(BuildChangeSetAuthor author) {
95103
this.author = author;
104+
return this;
96105
}
97106

98107
@Override

jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildChangeSetPath.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,18 @@ public String getEditType() {
2727
* @param editType the SCM operation, <code>add</code> or <code>edit</code> or <code>delete</code>
2828
* @see <a href="http://javadoc.jenkins.io/hudson/scm/EditType.html">EditType</a>
2929
*/
30-
public void setEditType(String editType) {
30+
public BuildChangeSetPath setEditType(String editType) {
3131
this.editType = editType;
32+
return this;
3233
}
3334

3435
public String getFile() {
3536
return file;
3637
}
3738

38-
public void setFile(String file) {
39+
public BuildChangeSetPath setFile(String file) {
3940
this.file = file;
41+
return this;
4042
}
4143

4244
@Override

0 commit comments

Comments
 (0)