This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 68c39617 authored by Daniel Rainer's avatar Daniel Rainer
Browse files

Add "file" metadata

parent 0ddbd63c
2 merge requests!17Initial Merge to Prepare Release 1.0.0,!2Add gitlab metadata
......@@ -5,6 +5,7 @@ import java.util.Objects;
public class SearchResultDTO {
private GitProject project;
private MetadataFile file;
private UserProvidedMetadataDTO metadata;
public SearchResultDTO() {
......@@ -19,6 +20,7 @@ public class SearchResultDTO {
public SearchResultDTO(SearchResultDTO toClone) {
super();
this.project = toClone.project;
this.file = toClone.file;
this.metadata = toClone.metadata;
}
......@@ -30,6 +32,14 @@ public class SearchResultDTO {
this.project = project;
}
public MetadataFile getFile() {
return file;
}
public void setFile(MetadataFile file) {
this.file = file;
}
public UserProvidedMetadataDTO getMetadata() {
return metadata;
}
......@@ -41,6 +51,7 @@ public class SearchResultDTO {
@Override
public String toString() {
return "SearchResultDTO : { project: " + this.project
+ ", file: " + this.file
+ ", metadata: " + this.metadata
+ " }";
}
......@@ -49,6 +60,7 @@ public class SearchResultDTO {
public int hashCode() {
int prime = 31;
int result = this.project.hashCode();
result = prime * result + this.file.hashCode();
result = prime * result + this.metadata.hashCode();
return result;
}
......@@ -63,6 +75,7 @@ public class SearchResultDTO {
}
SearchResultDTO other = (SearchResultDTO) obj;
return Objects.equals(this.project, other.project)
&& Objects.equals(this.file, other.file)
&& Objects.equals(this.metadata, other.metadata);
}
......@@ -158,4 +171,73 @@ public class SearchResultDTO {
+ " }";
}
}
public static class MetadataFile {
private String filename;
private String path;
private String commit_id;
private String indexing_date;
public String getFilename() {
return filename;
}
public void setFilename(String filename) {
this.filename = filename;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getCommit_id() {
return commit_id;
}
public void setCommit_id(String commit_id) {
this.commit_id = commit_id;
}
public String getIndexing_date() {
return indexing_date;
}
public void setIndexing_date(String indexing_date) {
this.indexing_date = indexing_date;
}
@Override
public int hashCode() {
final int prime = 31;
int result = this.path.hashCode();
result = prime * result + this.commit_id.hashCode();
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof MetadataFile)) {
return false;
}
MetadataFile other = (MetadataFile) obj;
return Objects.equals(this.path, other.path)
&& Objects.equals(this.commit_id, other.commit_id);
}
@Override
public String toString() {
return "MetadataFile: { filename: " + this.filename
+ ", path: " + this.path
+ ", commit_id: " + this.commit_id
+ ", indexing_date: " + this.indexing_date
+ " }";
}
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment