Skip to content

Commit 94f26c9

Browse files
authored
Fix wrongly named "*_at" members (#1062)
1 parent 7420c35 commit 94f26c9

File tree

5 files changed

+162
-36
lines changed

5 files changed

+162
-36
lines changed

src/main/java/org/gitlab4j/api/models/GpgKey.java

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
import java.util.Date;
44

5+
import com.fasterxml.jackson.annotation.JsonIgnore;
6+
57
public class GpgKey {
68

79
private Long id;
810
private String key;
9-
private Date created_at;
11+
private Date createdAt;
1012

1113
public Long getId() {
1214
return id;
@@ -24,11 +26,31 @@ public void setKey(String key) {
2426
this.key = key;
2527
}
2628

27-
public Date getCreated_at() {
28-
return created_at;
29+
30+
public Date getCreatedAt() {
31+
return createdAt;
2932
}
3033

31-
public void setCreated_at(Date created_at) {
32-
this.created_at = created_at;
34+
public void setCreatedAt(Date createdAt) {
35+
this.createdAt = createdAt;
3336
}
34-
}
37+
38+
/**
39+
* @deprecated Replaced by {@link #getCreatedAt()}
40+
* @return the created at Date
41+
*/
42+
@Deprecated
43+
@JsonIgnore
44+
public Date getCreated_at() {
45+
return createdAt;
46+
}
47+
48+
/**
49+
* @deprecated Replaced by {@link #setCreatedAt(Date)}
50+
* @param createdAt new created at value
51+
*/
52+
@Deprecated
53+
@JsonIgnore
54+
public void setCreated_at(Date createdAt) {
55+
this.createdAt = createdAt;
56+
}}

src/main/java/org/gitlab4j/api/models/PackageFile.java

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44

55
import org.gitlab4j.api.utils.JacksonJson;
66

7+
import com.fasterxml.jackson.annotation.JsonIgnore;
8+
79
public class PackageFile {
810

911
private Long id;
1012
private Long packageId;
11-
private Date created_at;
13+
private Date createdAt;
1214
private String fileName;
1315
private Long size;
1416
private String fileMd5;
@@ -30,14 +32,33 @@ public void setPackageId(Long packageId) {
3032
this.packageId = packageId;
3133
}
3234

33-
public Date getCreated_at() {
34-
return created_at;
35+
public Date getCreatedAt() {
36+
return createdAt;
37+
}
38+
39+
public void setCreatedAt(Date createdAt) {
40+
this.createdAt = createdAt;
3541
}
3642

37-
public void setCreated_at(Date created_at) {
38-
this.created_at = created_at;
43+
/**
44+
* @deprecated Replaced by {@link #getCreatedAt()}
45+
* @return the created at Date
46+
*/
47+
@Deprecated
48+
@JsonIgnore
49+
public Date getCreated_at() {
50+
return createdAt;
3951
}
4052

53+
/**
54+
* @deprecated Replaced by {@link #setCreatedAt(Date)}
55+
* @param createdAt new created at value
56+
*/
57+
@Deprecated
58+
@JsonIgnore
59+
public void setCreated_at(Date createdAt) {
60+
this.createdAt = createdAt;
61+
}
4162
public String getFileName() {
4263
return fileName;
4364
}

src/main/java/org/gitlab4j/api/models/Pipeline.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,32 +130,32 @@ public Date getUpdatedAt() {
130130
return updatedAt;
131131
}
132132

133-
public void setUpdatedAt(Date updated_at) {
134-
this.updatedAt = updated_at;
133+
public void setUpdatedAt(Date updatedAt) {
134+
this.updatedAt = updatedAt;
135135
}
136136

137137
public Date getStartedAt() {
138138
return startedAt;
139139
}
140140

141-
public void setStartedAt(Date started_at) {
142-
this.startedAt = started_at;
141+
public void setStartedAt(Date startedAt) {
142+
this.startedAt = startedAt;
143143
}
144144

145145
public Date getFinishedAt() {
146146
return finishedAt;
147147
}
148148

149-
public void setFinishedAt(Date finished_at) {
150-
this.finishedAt = finished_at;
149+
public void setFinishedAt(Date finishedAt) {
150+
this.finishedAt = finishedAt;
151151
}
152152

153153
public Date getCommittedAt() {
154154
return committedAt;
155155
}
156156

157-
public void setCommittedAt(Date committed_at) {
158-
this.committedAt = committed_at;
157+
public void setCommittedAt(Date committedAt) {
158+
this.committedAt = committedAt;
159159
}
160160

161161
/**

src/main/java/org/gitlab4j/api/webhook/BuildEvent.java

Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import org.gitlab4j.api.models.User;
66
import org.gitlab4j.api.utils.JacksonJson;
77

8+
import com.fasterxml.jackson.annotation.JsonIgnore;
9+
810
/**
911
* The documentation at: <a href="https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html#job-events">
1012
* Job Events</a> is incorrect, this class represents the actual content of the Job Hook event.
@@ -22,8 +24,8 @@ public class BuildEvent extends AbstractEvent {
2224
private String buildName;
2325
private String buildStage;
2426
private String buildStatus;
25-
private Date buildStarted_at;
26-
private Date buildFinished_at;
27+
private Date buildStartedAt;
28+
private Date buildFinishedAt;
2729
private Float buildDuration;
2830

2931
private Float buildQueuedDuration;
@@ -111,20 +113,60 @@ public void setBuildStatus(String buildStatus) {
111113
this.buildStatus = buildStatus;
112114
}
113115

116+
public Date getBuildStartedAt() {
117+
return buildStartedAt;
118+
}
119+
120+
public void setBuildStartedAt(Date buildStartedAt) {
121+
this.buildStartedAt = buildStartedAt;
122+
}
123+
124+
/**
125+
* @deprecated Replaced by {@link #getBuildStartedAt()}
126+
* @return the buildstarted at Date
127+
*/
128+
@Deprecated
129+
@JsonIgnore
114130
public Date getBuildStarted_at() {
115-
return buildStarted_at;
131+
return buildStartedAt;
132+
}
133+
134+
/**
135+
* @deprecated Replaced by {@link #setBuildStartedAt(Date)}
136+
* @param buildStartedAt new buildstarted at value
137+
*/
138+
@Deprecated
139+
@JsonIgnore
140+
public void setBuildStarted_at(Date buildStartedAt) {
141+
this.buildStartedAt = buildStartedAt;
142+
}
143+
144+
public Date getBuildFinishedAt() {
145+
return buildFinishedAt;
116146
}
117147

118-
public void setBuildStarted_at(Date buildStarted_at) {
119-
this.buildStarted_at = buildStarted_at;
148+
public void setBuildFinishedAt(Date buildFinishedAt) {
149+
this.buildFinishedAt = buildFinishedAt;
120150
}
121151

152+
/**
153+
* @deprecated Replaced by {@link #getBuildFinishedAt()}
154+
* @return the buildfinished at Date
155+
*/
156+
@Deprecated
157+
@JsonIgnore
122158
public Date getBuildFinished_at() {
123-
return buildFinished_at;
159+
return buildFinishedAt;
124160
}
125161

126-
public void setBuildFinished_at(Date buildFinished_at) {
127-
this.buildFinished_at = buildFinished_at;
162+
/**
163+
* @deprecated Replaced by {@link #setBuildFinishedAt(Date)}
164+
* @param buildFinishedAt new buildfinished at value
165+
*/
166+
@Deprecated
167+
@JsonIgnore
168+
public void setBuildFinished_at(Date buildFinishedAt) {
169+
this.buildFinishedAt = buildFinishedAt;
128170
}
129171

130172
public Float getBuildDuration() {

src/main/java/org/gitlab4j/api/webhook/JobEvent.java

Lines changed: 50 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import org.gitlab4j.api.models.User;
66
import org.gitlab4j.api.utils.JacksonJson;
77

8+
import com.fasterxml.jackson.annotation.JsonIgnore;
9+
810
public class JobEvent extends AbstractEvent {
911

1012
public static final String JOB_HOOK_X_GITLAB_EVENT = "Job Hook";
@@ -18,8 +20,8 @@ public class JobEvent extends AbstractEvent {
1820
private String jobName;
1921
private String jobStage;
2022
private String jobStatus;
21-
private Date jobStarted_at;
22-
private Date jobFinished_at;
23+
private Date jobStartedAt;
24+
private Date jobFinishedAt;
2325
private Integer jobDuration;
2426
private Boolean jobAllowFailure;
2527
private String jobFailureReason;
@@ -103,22 +105,61 @@ public void setJobStatus(String jobStatus) {
103105
this.jobStatus = jobStatus;
104106
}
105107

108+
public Date getJobStartedAt() {
109+
return jobStartedAt;
110+
}
111+
112+
public void setJobStartedAt(Date jobStartedAt) {
113+
this.jobStartedAt = jobStartedAt;
114+
}
115+
116+
/**
117+
* @deprecated Replaced by {@link #getJobStartedAt()}
118+
* @return the jobstarted at Date
119+
*/
120+
@Deprecated
121+
@JsonIgnore
106122
public Date getJobStarted_at() {
107-
return jobStarted_at;
123+
return jobStartedAt;
108124
}
109125

110-
public void setJobStarted_at(Date jobStarted_at) {
111-
this.jobStarted_at = jobStarted_at;
126+
/**
127+
* @deprecated Replaced by {@link #setJobStartedAt(Date)}
128+
* @param jobStartedAt new jobstarted at value
129+
*/
130+
@Deprecated
131+
@JsonIgnore
132+
public void setJobStarted_at(Date jobStartedAt) {
133+
this.jobStartedAt = jobStartedAt;
112134
}
113135

114-
public Date getJobFinished_at() {
115-
return jobFinished_at;
136+
public Date getJobFinishedAt() {
137+
return jobFinishedAt;
116138
}
117139

118-
public void setJobFinished_at(Date jobFinished_at) {
119-
this.jobFinished_at = jobFinished_at;
140+
public void setJobFinishedAt(Date jobFinishedAt) {
141+
this.jobFinishedAt = jobFinishedAt;
120142
}
121143

144+
/**
145+
* @deprecated Replaced by {@link #getJobFinishedAt()}
146+
* @return the jobfinished at Date
147+
*/
148+
@Deprecated
149+
@JsonIgnore
150+
public Date getJobFinished_at() {
151+
return jobFinishedAt;
152+
}
153+
154+
/**
155+
* @deprecated Replaced by {@link #setJobFinishedAt(Date)}
156+
* @param jobFinishedAt new jobfinished at value
157+
*/
158+
@Deprecated
159+
@JsonIgnore
160+
public void setJobFinished_at(Date jobFinishedAt) {
161+
this.jobFinishedAt = jobFinishedAt;
162+
}
122163
public Integer getJobDuration() {
123164
return jobDuration;
124165
}

0 commit comments

Comments
 (0)