2018-01-17 13:03:51 +01:00
|
|
|
package eu.eudat.models.externaldataset;
|
|
|
|
|
|
|
|
import eu.eudat.entities.ExternalDataset;
|
|
|
|
import eu.eudat.models.DataModel;
|
|
|
|
|
|
|
|
import javax.persistence.Column;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.UUID;
|
|
|
|
|
2018-02-01 10:08:06 +01:00
|
|
|
|
2018-02-16 08:45:18 +01:00
|
|
|
public class ExternalDatasetListingModel implements DataModel<ExternalDataset,ExternalDatasetListingModel> {
|
2018-01-17 13:03:51 +01:00
|
|
|
|
|
|
|
private UUID id;
|
|
|
|
private String label;
|
|
|
|
private String abbreviation;
|
|
|
|
private String reference;
|
|
|
|
private Date created;
|
|
|
|
private Date modified;
|
|
|
|
|
|
|
|
public UUID getId() {
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setId(UUID id) {
|
|
|
|
this.id = id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getLabel() {
|
|
|
|
return label;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setLabel(String label) {
|
|
|
|
this.label = label;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getAbbreviation() {
|
|
|
|
return abbreviation;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setAbbreviation(String abbreviation) {
|
|
|
|
this.abbreviation = abbreviation;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getReference() {
|
|
|
|
return reference;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setReference(String reference) {
|
|
|
|
this.reference = reference;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Date getCreated() {
|
|
|
|
return created;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setCreated(Date created) {
|
|
|
|
this.created = created;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Date getModified() {
|
|
|
|
return modified;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setModified(Date modified) {
|
|
|
|
this.modified = modified;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2018-02-16 08:45:18 +01:00
|
|
|
public ExternalDatasetListingModel fromDataModel(ExternalDataset entity) {
|
2018-01-17 13:03:51 +01:00
|
|
|
this.id = entity.getId();
|
|
|
|
this.abbreviation = entity.getAbbreviation();
|
|
|
|
this.label = entity.getLabel();
|
|
|
|
this.modified = entity.getModified();
|
|
|
|
this.created = entity.getCreated();
|
|
|
|
this.reference = entity.getReference();
|
2018-02-16 08:45:18 +01:00
|
|
|
return this;
|
2018-01-17 13:03:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ExternalDataset toDataModel() throws Exception {
|
|
|
|
ExternalDataset externalDataset = new ExternalDataset();
|
|
|
|
externalDataset.setAbbreviation(this.abbreviation);
|
|
|
|
externalDataset.setCreated(this.created != null ? this.created : new Date());
|
|
|
|
externalDataset.setLabel(this.label);
|
|
|
|
externalDataset.setId(this.id);
|
|
|
|
externalDataset.setModified(this.modified);
|
|
|
|
externalDataset.setReference(this.reference);
|
|
|
|
return externalDataset;
|
|
|
|
}
|
2018-01-19 10:31:05 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getHint() {
|
|
|
|
return null;
|
|
|
|
}
|
2018-01-17 13:03:51 +01:00
|
|
|
}
|