forked from jenkinsci/java-client-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuildCause.java
More file actions
117 lines (95 loc) · 3.39 KB
/
BuildCause.java
File metadata and controls
117 lines (95 loc) · 3.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*
* Copyright (c) 2013 Cosmin Stejerean, Karl Heinz Marbaise, and contributors.
*
* Distributed under the MIT license: http://opensource.org/licenses/MIT
*/
package com.offbytwo.jenkins.model;
public class BuildCause {
private String shortDescription;
// For upstreams
private Integer upstreamBuild;
private String upstreamProject;
private String upstreamUrl;
// For manual kickoffs
private String userId;
private String userName;
public BuildCause() {
this.upstreamBuild = new Integer(0);
//TODO: Think about initialization of the other
// attributes as well.
// userId = StringConstant.EMPTY;
}
public String getShortDescription() {
return shortDescription;
}
public BuildCause setShortDescription(String shortDescription) {
this.shortDescription = shortDescription;
return this;
}
public int getUpstreamBuild() {
return upstreamBuild;
}
public BuildCause setUpstreamBuild(Integer upstreamBuild) {
this.upstreamBuild = upstreamBuild;
return this;
}
public String getUpstreamProject() {
return upstreamProject;
}
public BuildCause setUpstreamProject(String upstreamProject) {
this.upstreamProject = upstreamProject;
return this;
}
public String getUpstreamUrl() {
return upstreamUrl;
}
public BuildCause setUpstreamUrl(String upstreamUrl) {
this.upstreamUrl = upstreamUrl;
return this;
}
public String getUserId() {
return userId;
}
public BuildCause setUserId(String userId) {
this.userId = userId;
return this;
}
public String getUserName() {
return userName;
}
public BuildCause setUserName(String userName) {
this.userName = userName;
return this;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
BuildCause that = (BuildCause) o;
if (shortDescription != null ? !shortDescription.equals(that.shortDescription) : that.shortDescription != null)
return false;
if (upstreamBuild != null ? !upstreamBuild.equals(that.upstreamBuild) : that.upstreamBuild != null)
return false;
if (upstreamProject != null ? !upstreamProject.equals(that.upstreamProject) : that.upstreamProject != null)
return false;
if (upstreamUrl != null ? !upstreamUrl.equals(that.upstreamUrl) : that.upstreamUrl != null)
return false;
if (userId != null ? !userId.equals(that.userId) : that.userId != null)
return false;
if (userName != null ? !userName.equals(that.userName) : that.userName != null)
return false;
return true;
}
@Override
public int hashCode() {
int result = shortDescription != null ? shortDescription.hashCode() : 0;
result = 31 * result + (upstreamBuild != null ? upstreamBuild.hashCode() : 0);
result = 31 * result + (upstreamProject != null ? upstreamProject.hashCode() : 0);
result = 31 * result + (upstreamUrl != null ? upstreamUrl.hashCode() : 0);
result = 31 * result + (userId != null ? userId.hashCode() : 0);
result = 31 * result + (userName != null ? userName.hashCode() : 0);
return result;
}
}