File tree Expand file tree Collapse file tree 3 files changed +87
-6
lines changed
jenkins-client/src/main/java/com/offbytwo/jenkins/model Expand file tree Collapse file tree 3 files changed +87
-6
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,6 @@ public class MavenJobWithDetails {
54
54
public MavenBuild getLastSuccessfulBuild ();
55
55
public MavenBuild getLastUnstableBuild ();
56
56
public MavenBuild getLastUnsuccessfulBuild ();
57
-
58
57
}
59
58
```
60
59
@@ -71,6 +70,16 @@ public class MavenJobWithDetails {
71
70
}
72
71
```
73
72
73
+ * [ Fixed Issue 198] [ issue-198 ]
74
+
75
+ Enhanced the ` QueueItem ` to add information about the task (QueueTask).
76
+
77
+ ``` java
78
+ public class QueueItem {
79
+ public QueueTask getTask ();
80
+ }
81
+ ```
82
+
74
83
75
84
## Release 0.3.6
76
85
@@ -662,6 +671,7 @@ TestReport testReport = mavenJob.getLastSuccessfulBuild().getTestReport();
662
671
[issue- 179 ]: https: // github.com/jenkinsci/java-client-api/issues/179
663
672
[issue- 182 ]: https: // github.com/jenkinsci/java-client-api/issues/182
664
673
[issue- 186 ]: https: // github.com/jenkinsci/java-client-api/issues/186
674
+ [issue- 198 ]: https: // github.com/jenkinsci/java-client-api/issues/198
665
675
[issue- 201 ]: https: // github.com/jenkinsci/java-client-api/issues/201
666
676
[issue- 202 ]: https: // github.com/jenkinsci/java-client-api/issues/202
667
677
[pull- 123 ]: https: // github.com/jenkinsci/java-client-api/pull/123
Original file line number Diff line number Diff line change @@ -15,13 +15,10 @@ public class QueueItem extends BaseModel {
15
15
16
16
private boolean stuck ;
17
17
18
- // task
19
- // name
20
- // url
21
- // color?
18
+ private QueueTask task ;
22
19
23
20
private String url ;
24
-
21
+
25
22
private String why ;
26
23
27
24
private boolean cancelled ;
@@ -72,6 +69,14 @@ public boolean isStuck() {
72
69
return stuck ;
73
70
}
74
71
72
+ public QueueTask getTask () {
73
+ return task ;
74
+ }
75
+
76
+ public void setTask (QueueTask task ) {
77
+ this .task = task ;
78
+ }
79
+
75
80
public void setStuck (boolean stuck ) {
76
81
this .stuck = stuck ;
77
82
}
@@ -120,6 +125,7 @@ public int hashCode() {
120
125
result = prime * result + ((inQueueSince == null ) ? 0 : inQueueSince .hashCode ());
121
126
result = prime * result + ((params == null ) ? 0 : params .hashCode ());
122
127
result = prime * result + (stuck ? 1231 : 1237 );
128
+ result = prime * result + ((task == null ) ? 0 : task .hashCode ());
123
129
result = prime * result + ((url == null ) ? 0 : url .hashCode ());
124
130
result = prime * result + ((why == null ) ? 0 : why .hashCode ());
125
131
return result ;
@@ -162,6 +168,11 @@ public boolean equals(Object obj) {
162
168
return false ;
163
169
if (stuck != other .stuck )
164
170
return false ;
171
+ if (task == null ) {
172
+ if (other .task != null )
173
+ return false ;
174
+ } else if (!task .equals (other .task ))
175
+ return false ;
165
176
if (url == null ) {
166
177
if (other .url != null )
167
178
return false ;
Original file line number Diff line number Diff line change
1
+ package com .offbytwo .jenkins .model ;
2
+
3
+ public class QueueTask {
4
+
5
+ private String name ;
6
+
7
+ private String url ;
8
+
9
+ private String color ;
10
+
11
+ public String getName () {
12
+ return name ;
13
+ }
14
+
15
+ public String getUrl () {
16
+ return url ;
17
+ }
18
+
19
+ public String getColor () {
20
+ return color ;
21
+ }
22
+
23
+ @ Override
24
+ public int hashCode () {
25
+ final int prime = 31 ;
26
+ int result = 1 ;
27
+ result = prime * result + ((color == null ) ? 0 : color .hashCode ());
28
+ result = prime * result + ((name == null ) ? 0 : name .hashCode ());
29
+ result = prime * result + ((url == null ) ? 0 : url .hashCode ());
30
+ return result ;
31
+ }
32
+
33
+ @ Override
34
+ public boolean equals (Object obj ) {
35
+ if (this == obj )
36
+ return true ;
37
+ if (obj == null )
38
+ return false ;
39
+ if (getClass () != obj .getClass ())
40
+ return false ;
41
+ QueueTask other = (QueueTask ) obj ;
42
+ if (color == null ) {
43
+ if (other .color != null )
44
+ return false ;
45
+ } else if (!color .equals (other .color ))
46
+ return false ;
47
+ if (name == null ) {
48
+ if (other .name != null )
49
+ return false ;
50
+ } else if (!name .equals (other .name ))
51
+ return false ;
52
+ if (url == null ) {
53
+ if (other .url != null )
54
+ return false ;
55
+ } else if (!url .equals (other .url ))
56
+ return false ;
57
+ return true ;
58
+ }
59
+
60
+ }
You can’t perform that action at this time.
0 commit comments