Update classes: "Publication" and "Payload".

This commit is contained in:
Lampros Smyrnaios 2021-04-24 21:40:10 +03:00
parent 85ecc4a36b
commit a6ab810ad3
2 changed files with 86 additions and 11 deletions

View File

@ -14,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
"mime_type", "mime_type",
"size", "size",
"more_info", "more_info",
"md5", "hash",
"location", "location",
"provenance" "provenance"
}) })
@ -41,8 +41,8 @@ public class Payload {
@JsonProperty("more_info") @JsonProperty("more_info")
private String more_info; private String more_info;
@JsonProperty("md5") @JsonProperty("hash")
private String md5; private String hash;
@JsonProperty("location") @JsonProperty("location")
private String location; private String location;
@ -107,12 +107,12 @@ public class Payload {
this.more_info = more_info; this.more_info = more_info;
} }
public String getMd5() { public String getHash() {
return md5; return hash;
} }
public void setMd5(String md5) { public void setHash(String hash) {
this.md5 = md5; this.hash = hash;
} }
public String getLocation() { public String getLocation() {
@ -141,7 +141,7 @@ public class Payload {
", mime_type='" + mime_type + '\'' + ", mime_type='" + mime_type + '\'' +
", size='" + size + '\'' + ", size='" + size + '\'' +
", more_info='" + more_info + '\'' + ", more_info='" + more_info + '\'' +
", md5='" + md5 + '\'' + ", hash='" + hash + '\'' +
", location='" + location + '\'' + ", location='" + location + '\'' +
", provenance='" + provenance + '\'' + ", provenance='" + provenance + '\'' +
'}'; '}';

View File

@ -5,12 +5,17 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.util.List;
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({ @JsonPropertyOrder({
"id", "id",
"dedupid", "dedupid",
"terms_of_reuse" "pids",
"urls",
"datasource",
"termsOfReuse"
}) })
public class Publication { public class Publication {
@ -20,8 +25,78 @@ public class Publication {
@JsonProperty("dedupid") @JsonProperty("dedupid")
private String dedupid; private String dedupid;
@JsonProperty("terms_of_reuse") @JsonProperty("pids")
private String terms_of_reuse; private List<String> pids;
@JsonProperty("urls")
private List<String> urls;
@JsonProperty("datasource")
private Datasource datasource;
@JsonProperty("termsOfReuse")
private String termsOfReuse; // Takes values from the TermsOfReuseEnum.
public Publication(String id, String dedupid, List<String> pids, List<String> urls, Datasource datasource, String termsOfReuse) {
this.id = id;
this.dedupid = dedupid;
this.pids = pids;
this.urls = urls;
this.datasource = datasource;
this.termsOfReuse = termsOfReuse;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getDedupid() {
return dedupid;
}
public void setDedupid(String dedupid) {
this.dedupid = dedupid;
}
public List<String> getPids() {
return pids;
}
public void setPids(List<String> pids) {
this.pids = pids;
}
public List<String> getUrls() {
return urls;
}
public void setUrls(List<String> urls) {
this.urls = urls;
}
public Datasource getDatasource() {
return datasource;
}
public void setDatasource(Datasource datasource) {
this.datasource = datasource;
}
public String getTermsOfReuse() {
return termsOfReuse;
}
public void setTermsOfReuse(String termsOfReuse) {
this.termsOfReuse = termsOfReuse;
}
public enum TermsOfReuseEnum {
Full, Mining, Internal
}
} }