56 lines
1.2 KiB
Java
56 lines
1.2 KiB
Java
package eu.eudat.model.publicapi.doi;
|
|
|
|
import eu.eudat.data.EntityDoiEntity;
|
|
|
|
import java.util.UUID;
|
|
|
|
public class DoiPublicModel {
|
|
private UUID id;
|
|
private String repositoryId;
|
|
private String doi;
|
|
|
|
public UUID getId() {
|
|
return id;
|
|
}
|
|
public void setId(UUID id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getRepositoryId() {
|
|
return repositoryId;
|
|
}
|
|
public void setRepositoryId(String repositoryId) {
|
|
this.repositoryId = repositoryId;
|
|
}
|
|
|
|
public String getDoi() {
|
|
return doi;
|
|
}
|
|
public void setDoi(String doi) {
|
|
this.doi = doi;
|
|
}
|
|
|
|
public DoiPublicModel fromDataModel(EntityDoiEntity entity) {
|
|
this.id = entity.getId();
|
|
this.repositoryId = entity.getRepositoryId();
|
|
this.doi = entity.getDoi();
|
|
return this;
|
|
}
|
|
|
|
public EntityDoiEntity toDataModel() throws Exception {
|
|
EntityDoiEntity entity = new EntityDoiEntity();
|
|
entity.setId(this.getId());
|
|
entity.setRepositoryId(this.getRepositoryId());
|
|
entity.setDoi(this.getDoi());
|
|
return entity;
|
|
}
|
|
|
|
public String generateLabel() {
|
|
return this.getDoi();
|
|
}
|
|
|
|
public String getHint() {
|
|
return null;
|
|
}
|
|
}
|