73 lines
1.8 KiB
Java
73 lines
1.8 KiB
Java
package org.gcube.data_catalogue.grsf_publish_ws.json.input;
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
import javax.validation.constraints.Size;
|
|
|
|
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.Group;
|
|
import org.gcube.data_catalogue.grsf_publish_ws.utils.groups.Source;
|
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
|
/**
|
|
* A resource object bean for the database source. The name description has a controlled vocabulary
|
|
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
|
*/
|
|
@JsonIgnoreProperties(ignoreUnknown = true) // ignore in serialization/deserialization
|
|
public class DatabaseSource {
|
|
|
|
@JsonProperty("url")
|
|
@NotNull(message="'url' attribute of database_source cannot be null")
|
|
@Size(min=1, message="'url' attribute of database_source cannot be empty")
|
|
private String url;
|
|
|
|
@JsonProperty("description")
|
|
private String description;
|
|
|
|
@JsonProperty("name")
|
|
@Group
|
|
@NotNull(message="'name' attribute of database_source is missing or wrong")
|
|
private Source name;
|
|
|
|
public DatabaseSource() {
|
|
super();
|
|
}
|
|
|
|
public DatabaseSource(String url, String description, Source name) {
|
|
super();
|
|
this.url = url;
|
|
this.description = description;
|
|
this.name = name;
|
|
}
|
|
|
|
public String getUrl() {
|
|
return url;
|
|
}
|
|
|
|
public void setUrl(String url) {
|
|
this.url = url;
|
|
}
|
|
|
|
public String getDescription() {
|
|
return description;
|
|
}
|
|
|
|
public void setDescription(String description) {
|
|
this.description = description;
|
|
}
|
|
|
|
public Source getName() {
|
|
return name;
|
|
}
|
|
|
|
public void setName(Source name) {
|
|
this.name = name;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "DatabaseSource [url=" + url + ", description=" + description
|
|
+ ", name=" + name + "]";
|
|
}
|
|
}
|