90 lines
2.3 KiB
Java
90 lines
2.3 KiB
Java
package eu.eudat.models.data.dataset;
|
|
|
|
import eu.eudat.models.DataModel;
|
|
import eu.eudat.logic.utilities.helpers.LabelGenerator;
|
|
|
|
import java.util.Date;
|
|
import java.util.UUID;
|
|
|
|
public class Registry implements DataModel<eu.eudat.data.entities.Registry, Registry>, LabelGenerator {
|
|
private UUID id;
|
|
private String label;
|
|
private String abbreviation;
|
|
private String reference;
|
|
private String uri;
|
|
private String definition;
|
|
|
|
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;
|
|
}
|
|
@Override
|
|
public String generateLabel() {
|
|
return getLabel();
|
|
}
|
|
public void setAbbreviation(String abbreviation) {
|
|
this.abbreviation = abbreviation;
|
|
}
|
|
|
|
public String getReference() {
|
|
return reference;
|
|
}
|
|
public void setReference(String reference) {
|
|
this.reference = reference;
|
|
}
|
|
|
|
public String getUri() {
|
|
return uri;
|
|
}
|
|
public void setUri(String uri) {
|
|
this.uri = uri;
|
|
}
|
|
|
|
public String getDefinition() {
|
|
return definition;
|
|
}
|
|
public void setDefinition(String definition) {
|
|
this.definition = definition;
|
|
}
|
|
|
|
public Registry fromDataModel(eu.eudat.data.entities.Registry entity) {
|
|
this.id = entity.getId();
|
|
this.label = entity.getLabel();
|
|
this.abbreviation = entity.getAbbreviation();
|
|
this.reference = entity.getReference();
|
|
this.uri = entity.getUri();
|
|
this.definition = entity.getDefinition();
|
|
return this;
|
|
}
|
|
|
|
public eu.eudat.data.entities.Registry toDataModel() {
|
|
eu.eudat.data.entities.Registry entity = new eu.eudat.data.entities.Registry();
|
|
entity.setId(this.id != null ? this.id : UUID.randomUUID());
|
|
entity.setLabel(this.label);
|
|
entity.setAbbreviation(this.abbreviation);
|
|
entity.setReference("dmpdata/" + this.label);
|
|
entity.setUri(this.uri);
|
|
entity.setModified(new Date());
|
|
entity.setStatus((short)0);
|
|
return entity;
|
|
}
|
|
|
|
@Override
|
|
public String getHint() {
|
|
return null;
|
|
}
|
|
}
|