private final CeTask ceTask;
private final Branch branch;
private final QualityGate qualityGate;
- private final Long date;
+ private final Long updatedAt;
private final Map<String, String> properties;
private final Analysis analysis;
public ProjectAnalysis(Project project, @Nullable CeTask ceTask, @Nullable Analysis analysis,
- @Nullable Branch branch, @Nullable QualityGate qualityGate, @Nullable Long date,
+ @Nullable Branch branch, @Nullable QualityGate qualityGate, @Nullable Long updatedAt,
Map<String, String> properties) {
this.project = requireNonNull(project, "project can't be null");
this.ceTask = ceTask;
this.branch = branch;
this.qualityGate = qualityGate;
- this.date = date;
+ this.updatedAt = updatedAt;
this.properties = copyOf(requireNonNull(properties, "properties can't be null"));
this.analysis = analysis;
}
return Optional.ofNullable(analysis);
}
+ public Optional<Long> getUpdatedAt() {
+ return Optional.ofNullable(updatedAt);
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) {
Objects.equals(ceTask, that.ceTask) &&
Objects.equals(branch, that.branch) &&
Objects.equals(qualityGate, that.qualityGate) &&
- Objects.equals(date, that.date) &&
+ Objects.equals(updatedAt, that.updatedAt) &&
Objects.equals(properties, that.properties) &&
Objects.equals(analysis, that.analysis);
}
@Override
public int hashCode() {
- return Objects.hash(project, ceTask, branch, qualityGate, date, properties, analysis);
+ return Objects.hash(project, ceTask, branch, qualityGate, updatedAt, properties, analysis);
}
@Override
", ceTask=" + ceTask +
", branch=" + branch +
", qualityGate=" + qualityGate +
- ", date=" + date +
+ ", updatedAt=" + updatedAt +
", properties=" + properties +
", analysis=" + analysis +
'}';
@Test
public void verify_toString() {
assertThat(underTest.toString()).isEqualTo(
- "ProjectAnalysis{project=Project{uuid='uuid', key='key', name='name'}, ceTask=CeTask{id='id', status=SUCCESS}, branch=Branch{main=true, name='name', type=SHORT}, qualityGate=QualityGate{id='id', name='name', status=WARN, conditions=[]}, date=1, properties={a=b}, analysis=Analysis{uuid='analysis_uuid', date=1500}}");
+ "ProjectAnalysis{project=Project{uuid='uuid', key='key', name='name'}, ceTask=CeTask{id='id', status=SUCCESS}, branch=Branch{main=true, name='name', type=SHORT}, qualityGate=QualityGate{id='id', name='name', status=WARN, conditions=[]}, updatedAt=1, properties={a=b}, analysis=Analysis{uuid='analysis_uuid', date=1500}}");
}
}