83 lines
1.9 KiB
Java
83 lines
1.9 KiB
Java
package eu.eudat.model.doi;
|
|
|
|
import eu.eudat.data.EntityDoiEntity;
|
|
import eu.eudat.model.Dmp;
|
|
|
|
import java.util.Date;
|
|
import java.util.UUID;
|
|
|
|
public class Doi {
|
|
private UUID id;
|
|
private String repositoryId;
|
|
private String doi;
|
|
private Date createdAt;
|
|
private Date updatedAt;
|
|
private Dmp dmp;
|
|
|
|
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 Date getCreatedAt() {
|
|
return createdAt;
|
|
}
|
|
public void setCreatedAt(Date createdAt) {
|
|
this.createdAt = createdAt;
|
|
}
|
|
|
|
public Date getUpdatedAt() {
|
|
return updatedAt;
|
|
}
|
|
public void setUpdatedAt(Date updatedAt) {
|
|
this.updatedAt = updatedAt;
|
|
}
|
|
|
|
public Dmp getDmp() {
|
|
return dmp;
|
|
}
|
|
public void setDmp(Dmp dmp) {
|
|
this.dmp = dmp;
|
|
}
|
|
|
|
public static Doi fromDataModel(EntityDoiEntity entity) {
|
|
Doi doi1 = new Doi();
|
|
doi1.id = entity.getId();
|
|
doi1.repositoryId = entity.getRepositoryId();
|
|
doi1.doi = entity.getDoi();
|
|
doi1.createdAt = Date.from(entity.getCreatedAt());
|
|
doi1.updatedAt = Date.from(entity.getUpdatedAt());
|
|
return doi1;
|
|
}
|
|
|
|
public EntityDoiEntity toDataModel() throws Exception {
|
|
EntityDoiEntity entityDoi = new EntityDoiEntity();
|
|
entityDoi.setId(this.id);
|
|
entityDoi.setRepositoryId(this.repositoryId);
|
|
entityDoi.setDoi(this.doi);
|
|
entityDoi.setCreatedAt(this.createdAt.toInstant());
|
|
entityDoi.setUpdatedAt(this.updatedAt.toInstant());
|
|
return entityDoi;
|
|
}
|
|
|
|
public String getHint() {
|
|
return null;
|
|
}
|
|
}
|