added similar_record property

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/grsf-publisher-ws@151091 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2017-07-14 14:13:10 +00:00
parent bbb94d70a3
commit c60da0676d
2 changed files with 107 additions and 10 deletions

View File

@ -97,6 +97,10 @@ public class Common extends Base{
@CustomField(key="Species")
private List<String> species;
@JsonProperty("similar_records")
@CustomField(key="Similar Records")
private List<SimilarRecordBean> similarRecords;
public Common() {
super();
}
@ -116,6 +120,7 @@ public class Common extends Base{
* @param catches
* @param landings
* @param species
* @param similarRecords
*/
public Common(List<String> dataOwner,
List<Resource<Sources>> databaseSources,
@ -125,7 +130,8 @@ public class Common extends Base{
List<TimeSeriesBean<Void, Void>> reportingYear,
List<TimeSeriesBean<Void, Void>> referenceYear, String grsfType,
String sourceType, List<TimeSeriesBean<String, String>> catches,
List<TimeSeriesBean<String, String>> landings, List<String> species) {
List<TimeSeriesBean<String, String>> landings,
List<String> species, List<SimilarRecordBean> similarRecords) {
super();
this.dataOwner = dataOwner;
this.databaseSources = databaseSources;
@ -141,6 +147,7 @@ public class Common extends Base{
this.catches = catches;
this.landings = landings;
this.species = species;
this.similarRecords = similarRecords;
}
public String getGrsfType() {
@ -259,17 +266,38 @@ public class Common extends Base{
return referenceYear;
}
public List<SimilarRecordBean> getSimilarRecords() {
return similarRecords;
}
public void setSimilarRecords(List<SimilarRecordBean> similarRecords) {
this.similarRecords = similarRecords;
}
@Override
public String toString() {
return "Common [dataOwner=" + dataOwner + ", databaseSources="
+ databaseSources + ", sourceOfInformation="
+ sourceOfInformation + ", refersTo=" + refersTo
+ ", shortTitle=" + shortTitle + ", traceabilityFlag="
+ traceabilityFlag + ", status=" + status + ", reportingYear="
+ reportingYear + ", referenceYear=" + referenceYear
+ ", grsfType=" + grsfType + ", sourceType=" + sourceType
+ ", catches=" + catches + ", landings=" + landings
+ ", species=" + species + "]";
return "Common ["
+ (dataOwner != null ? "dataOwner=" + dataOwner + ", " : "")
+ (databaseSources != null ? "databaseSources="
+ databaseSources + ", " : "")
+ (sourceOfInformation != null ? "sourceOfInformation="
+ sourceOfInformation + ", " : "")
+ (refersTo != null ? "refersTo=" + refersTo + ", " : "")
+ (shortTitle != null ? "shortTitle=" + shortTitle + ", " : "")
+ (traceabilityFlag != null ? "traceabilityFlag="
+ traceabilityFlag + ", " : "")
+ (status != null ? "status=" + status + ", " : "")
+ (reportingYear != null ? "reportingYear=" + reportingYear
+ ", " : "")
+ (referenceYear != null ? "referenceYear=" + referenceYear
+ ", " : "")
+ (grsfType != null ? "grsfType=" + grsfType + ", " : "")
+ (sourceType != null ? "sourceType=" + sourceType + ", " : "")
+ (catches != null ? "catches=" + catches + ", " : "")
+ (landings != null ? "landings=" + landings + ", " : "")
+ (species != null ? "species=" + species + ", " : "")
+ (similarRecords != null ? "similarRecords=" + similarRecords
: "") + "]";
}
}

View File

@ -0,0 +1,69 @@
package org.gcube.data_catalogue.grsf_publish_ws.json.input;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Similar record information.
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
*/
public class SimilarRecordBean {
@JsonProperty("url")
String url;
@JsonProperty("id")
String id;
@JsonProperty("description")
String description;
public SimilarRecordBean() {
super();
}
/**
* @param url
* @param id
* @param description
*/
public SimilarRecordBean(String url, String id, String description) {
super();
this.url = url;
this.id = id;
this.description = description;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Override
public String toString() {
String toReturn = "";
toReturn += url != null ? "url = " + url + ", " : "";
toReturn += id != null ? "id = " + id + ", " : "";
toReturn += description != null ? "description = " + description : "";
toReturn = toReturn.endsWith(", ") ? toReturn.substring(0, toReturn.length() - 2) : toReturn;
return toReturn;
}
}