85 lines
2.0 KiB
Java
85 lines
2.0 KiB
Java
package eu.eudat.models.data.dataset;
|
|
|
|
import eu.eudat.models.DataModel;
|
|
import eu.eudat.logic.utilities.helpers.LabelGenerator;
|
|
|
|
import java.util.Date;
|
|
|
|
public class DataRepository implements DataModel<eu.eudat.data.entities.DataRepository, DataRepository>, LabelGenerator {
|
|
private String pid;
|
|
private String label;
|
|
private String uri;
|
|
private String info;
|
|
private String reference;
|
|
|
|
public String getPid() {
|
|
return pid;
|
|
}
|
|
|
|
public void setPid(String pid) {
|
|
this.pid = pid;
|
|
}
|
|
|
|
public String getLabel() {
|
|
return label;
|
|
}
|
|
|
|
public void setLabel(String label) {
|
|
this.label = label;
|
|
}
|
|
|
|
public String getUri() {
|
|
return uri;
|
|
}
|
|
|
|
public void setUri(String uri) {
|
|
this.uri = uri;
|
|
}
|
|
|
|
public String getInfo() {
|
|
return info;
|
|
}
|
|
|
|
public void setInfo(String info) {
|
|
this.info = info;
|
|
}
|
|
|
|
public String getReference() {
|
|
return reference;
|
|
}
|
|
|
|
public void setReference(String reference) {
|
|
this.reference = reference;
|
|
}
|
|
|
|
public DataRepository fromDataModel(eu.eudat.data.entities.DataRepository entity) {
|
|
this.pid = entity.getReference();
|
|
this.label = entity.getLabel();
|
|
this.uri = entity.getUri();
|
|
this.reference = entity.getReference();
|
|
return this;
|
|
}
|
|
|
|
public eu.eudat.data.entities.DataRepository toDataModel() {
|
|
eu.eudat.data.entities.DataRepository entity = new eu.eudat.data.entities.DataRepository();
|
|
entity.setReference(this.pid);
|
|
entity.setLabel(this.label);
|
|
entity.setUri(this.uri);
|
|
entity.setCreated(new Date());
|
|
entity.setModified(new Date());
|
|
entity.setStatus((short) 0);
|
|
entity.setReference("dmpdata/" + this.label);
|
|
return entity;
|
|
}
|
|
|
|
@Override
|
|
public String generateLabel() {
|
|
return this.getLabel();
|
|
}
|
|
|
|
@Override
|
|
public String getHint() {
|
|
return null;
|
|
}
|
|
}
|