191 lines
4.9 KiB
Java
191 lines
4.9 KiB
Java
package org.gcube.data_catalogue.grsf_publish_ws.json.input;
|
|
|
|
import java.util.List;
|
|
|
|
import javax.validation.Valid;
|
|
|
|
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.CkanResource;
|
|
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.CustomField;
|
|
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.Group;
|
|
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.Tag;
|
|
import org.gcube.data_catalogue.grsf_publish_ws.utils.groups.Sources;
|
|
import org.gcube.data_catalogue.grsf_publish_ws.utils.groups.Status;
|
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
|
/**
|
|
* Information that both Stock and Fishery records must contain.
|
|
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
|
*/
|
|
@JsonIgnoreProperties(value = {"product_type"})
|
|
public class CommonAggregated extends Base{
|
|
|
|
public static final String PRODUCT_TYPE_KEY = "Product type";
|
|
|
|
@JsonProperty("data_owner")
|
|
@CustomField(key="Data owner")
|
|
private String dataOwner;
|
|
|
|
@JsonProperty("database_sources")
|
|
@CkanResource
|
|
// @NotNull(message="database_source cannot be null")
|
|
// @Size(min=1, message="database_source cannot be empty")
|
|
@Tag
|
|
@Valid
|
|
private List<Resource<Sources>> databaseSources;
|
|
|
|
@JsonProperty("source_of_information")
|
|
@CkanResource
|
|
@Valid
|
|
private List<Resource<String>> sourceOfInformation;
|
|
|
|
@JsonProperty("refers_to")
|
|
@CustomField(key="Refers to")
|
|
@Valid
|
|
private List<RefersToBean> refersTo;
|
|
|
|
@JsonProperty("short_title")
|
|
@CustomField(key="Short Title")
|
|
// @NotNull(message="short_title cannot be null")
|
|
// @Size(min=1, message="short_title cannot be empty")
|
|
private String shortTitle;
|
|
|
|
@JsonProperty("traceability_flag")
|
|
@CustomField(key="Traceability Flag")
|
|
// @NotNull(message="traceability_flag cannot be null")
|
|
private boolean traceabilityFlag;
|
|
|
|
@JsonProperty("status")
|
|
@CustomField(key="Status")
|
|
@Group
|
|
@Tag
|
|
private Status status;
|
|
|
|
@JsonProperty("reporting_year")
|
|
@CustomField(key="Reporting year")
|
|
private Long reportingYear;
|
|
|
|
// automatically compiled
|
|
@JsonProperty("product_type")
|
|
@CustomField(key=PRODUCT_TYPE_KEY)
|
|
@Tag
|
|
@Group
|
|
private String productType;
|
|
|
|
public CommonAggregated() {
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* @param dataOwner
|
|
* @param databaseSources
|
|
* @param sourceOfInformation
|
|
* @param refersTo
|
|
* @param shortTitle
|
|
* @param traceabilityFlag
|
|
* @param status
|
|
* @param reportingYear
|
|
* @param productType
|
|
*/
|
|
public CommonAggregated(String dataOwner, List<Resource<Sources>> databaseSources,
|
|
List<Resource<String>> sourceOfInformation,
|
|
List<RefersToBean> refersTo, String shortTitle,
|
|
boolean traceabilityFlag, Status status, Long reportingYear,
|
|
String productType) {
|
|
super();
|
|
this.dataOwner = dataOwner;
|
|
this.databaseSources = databaseSources;
|
|
this.sourceOfInformation = sourceOfInformation;
|
|
this.refersTo = refersTo;
|
|
this.shortTitle = shortTitle;
|
|
this.traceabilityFlag = traceabilityFlag;
|
|
this.status = status;
|
|
this.reportingYear = reportingYear;
|
|
this.productType = productType;
|
|
}
|
|
|
|
public List<RefersToBean> getRefersTo() {
|
|
return refersTo;
|
|
}
|
|
|
|
public void setRefersTo(List<RefersToBean> refersTo) {
|
|
this.refersTo = refersTo;
|
|
}
|
|
|
|
public Long getReportingYear() {
|
|
return reportingYear;
|
|
}
|
|
|
|
public void setReportingYear(Long reportingYear) {
|
|
this.reportingYear = reportingYear;
|
|
}
|
|
|
|
public List<Resource<Sources>> getDatabaseSources() {
|
|
return databaseSources;
|
|
}
|
|
|
|
public void setDatabaseSources(List<Resource<Sources>> databaseSources) {
|
|
this.databaseSources = databaseSources;
|
|
}
|
|
|
|
public List<Resource<String>> getSourceOfInformation() {
|
|
return sourceOfInformation;
|
|
}
|
|
|
|
public void setSourceOfInformation(List<Resource<String>> sourceOfInformation) {
|
|
this.sourceOfInformation = sourceOfInformation;
|
|
}
|
|
|
|
public String getProductType() {
|
|
return productType;
|
|
}
|
|
|
|
public void setProductType(String productType) {
|
|
this.productType = productType;
|
|
}
|
|
|
|
public String getDataOwner() {
|
|
return dataOwner;
|
|
}
|
|
|
|
public void setDataOwner(String dataOwner) {
|
|
this.dataOwner = dataOwner;
|
|
}
|
|
|
|
public String getShortTitle() {
|
|
return shortTitle;
|
|
}
|
|
|
|
public void setShortTitle(String shortTitle) {
|
|
this.shortTitle = shortTitle;
|
|
}
|
|
|
|
public boolean isTraceabilityFlag() {
|
|
return traceabilityFlag;
|
|
}
|
|
|
|
public void setTraceabilityFlag(boolean traceabilityFlag) {
|
|
this.traceabilityFlag = traceabilityFlag;
|
|
}
|
|
|
|
public Status getStatus() {
|
|
return status;
|
|
}
|
|
|
|
public void setStatus(Status status) {
|
|
this.status = status;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "Common [dataOwner=" + dataOwner + ", databaseSources="
|
|
+ databaseSources + ", sourceOfInformation="
|
|
+ sourceOfInformation + ", refersTo=" + refersTo
|
|
+ ", shortTitle=" + shortTitle + ", traceabilityFlag="
|
|
+ traceabilityFlag + ", status=" + status + ", reportingYear="
|
|
+ reportingYear + ", productType=" + productType + "]";
|
|
}
|
|
|
|
}
|