argos/dmp-backend/web/src/main/java/eu/eudat/models/data/dataset/DataRepository.java

85 lines
1.9 KiB
Java
Raw Normal View History

2018-06-27 12:29:21 +02:00
package eu.eudat.models.data.dataset;
2017-12-08 15:52:12 +01:00
2017-12-15 00:01:26 +01:00
import eu.eudat.models.DataModel;
2018-06-27 12:29:21 +02:00
import eu.eudat.logic.utilities.helpers.LabelGenerator;
2017-12-08 15:52:12 +01:00
import java.util.Date;
2018-03-21 11:57:56 +01:00
public class DataRepository implements DataModel<eu.eudat.data.entities.DataRepository, DataRepository>, LabelGenerator {
2018-02-16 11:34:02 +01:00
private String pid;
2018-09-04 11:36:18 +02:00
private String label;
2018-02-16 11:34:02 +01:00
private String uri;
2018-05-28 11:50:42 +02:00
private String info;
2018-09-04 11:36:18 +02:00
private String reference;
2017-12-08 15:52:12 +01:00
2018-02-16 11:34:02 +01:00
public String getPid() {
return pid;
}
2017-12-08 15:52:12 +01:00
2018-02-16 11:34:02 +01:00
public void setPid(String pid) {
this.pid = pid;
}
2017-12-08 15:52:12 +01:00
2018-09-04 11:36:18 +02:00
public String getLabel() {
return label;
2018-02-16 11:34:02 +01:00
}
2017-12-08 15:52:12 +01:00
2018-09-04 11:36:18 +02:00
public void setLabel(String label) {
this.label = label;
2018-02-16 11:34:02 +01:00
}
2017-12-08 15:52:12 +01:00
2018-02-16 11:34:02 +01:00
public String getUri() {
return uri;
}
2017-12-08 15:52:12 +01:00
2018-02-16 11:34:02 +01:00
public void setUri(String uri) {
this.uri = uri;
}
2017-12-19 17:22:30 +01:00
2018-05-28 11:50:42 +02:00
public String getInfo() {
return info;
}
public void setInfo(String info) {
this.info = info;
}
2018-09-04 11:36:18 +02:00
public String getReference() {
return reference;
}
public void setReference(String reference) {
this.reference = reference;
}
2018-03-21 11:57:56 +01:00
public DataRepository fromDataModel(eu.eudat.data.entities.DataRepository entity) {
2018-02-16 11:34:02 +01:00
this.pid = entity.getReference();
2018-09-04 11:36:18 +02:00
this.label = entity.getLabel();
2018-02-16 11:34:02 +01:00
this.uri = entity.getUri();
2018-09-04 11:36:18 +02:00
this.reference = entity.getReference();
2018-02-16 11:34:02 +01:00
return this;
}
2018-01-19 10:31:05 +01:00
2018-03-21 11:57:56 +01:00
public eu.eudat.data.entities.DataRepository toDataModel() {
eu.eudat.data.entities.DataRepository entity = new eu.eudat.data.entities.DataRepository();
2018-02-16 11:34:02 +01:00
entity.setReference(this.pid);
2018-09-04 11:36:18 +02:00
entity.setLabel(this.label);
2018-02-16 11:34:02 +01:00
entity.setUri(this.uri);
entity.setCreated(new Date());
entity.setModified(new Date());
entity.setStatus((short) 0);
2018-09-04 11:36:18 +02:00
entity.setReference(this.reference);
2018-02-16 11:34:02 +01:00
return entity;
}
@Override
public String generateLabel() {
2018-09-04 11:36:18 +02:00
return this.getLabel();
2018-02-16 11:34:02 +01:00
}
@Override
public String getHint() {
return null;
}
2017-12-08 15:52:12 +01:00
}