-
Notifications
You must be signed in to change notification settings - Fork 314
/
Copy pathGitlabCommit.java
156 lines (116 loc) · 3.31 KB
/
GitlabCommit.java
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
package org.gitlab.api.models;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Date;
import java.util.List;
public class GitlabCommit {
public final static String URL = "/commits";
private String id;
private String title;
private String message;
@JsonProperty("short_id")
private String shortId;
@JsonProperty("author_name")
private String authorName;
@JsonProperty("author_email")
private String authorEmail;
@JsonProperty("created_at")
private Date createdAt;
@JsonProperty("committed_date")
private Date committedDate;
@JsonProperty("authored_date")
private Date authoredDate;
@JsonProperty("parent_ids")
private List<String> parentIds;
@JsonProperty("stats")
private GitlabCommitStats stats;
@JsonProperty("last_pipeline")
private GitlabPipeline lastPipeline;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getShortId() {
return shortId;
}
public void setShortId(String shortId) {
this.shortId = shortId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getAuthorName() {
return authorName;
}
public void setAuthorName(String authorName) {
this.authorName = authorName;
}
public String getAuthorEmail() {
return authorEmail;
}
public void setAuthorEmail(String authorEmail) {
this.authorEmail = authorEmail;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public List<String> getParentIds() {
return parentIds;
}
public void setParentIds(List<String> parentIds) {
this.parentIds = parentIds;
}
public Date getCommittedDate() {
return committedDate;
}
public void setCommittedDate(Date committedDate) {
this.committedDate = committedDate;
}
public Date getAuthoredDate() {
return authoredDate;
}
public void setAuthoredDate(Date authoredDate) {
this.authoredDate = authoredDate;
}
public GitlabCommitStats getStats() {
return stats;
}
public void setStats(GitlabCommitStats stats) {
this.stats = stats;
}
@Override
public boolean equals(Object obj) {
// we say that two commit objects are equal iff they have the same ID
// this prevents us from having to do clever workarounds for
// https://gitlab.com/gitlab-org/gitlab-ce/issues/759
try {
GitlabCommit commitObj = (GitlabCommit) obj;
return (this.getId().compareTo(commitObj.getId()) == 0);
} catch (ClassCastException e) {
return false;
}
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
public GitlabPipeline getLastPipeline() {
return lastPipeline;
}
public void setLastPipeline(GitlabPipeline lastPipeline) {
this.lastPipeline = lastPipeline;
}
}