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

244 lines
6.8 KiB
Java
Raw Normal View History

2023-10-18 17:05:39 +02:00
package eu.eudat.models.data;
2023-10-23 16:58:56 +02:00
2023-10-19 16:56:53 +02:00
import java.util.Map;
2023-10-18 17:05:39 +02:00
2023-10-26 13:38:18 +02:00
public class FetcherReference {
2023-10-19 16:56:53 +02:00
private String id;
2023-10-18 17:05:39 +02:00
private String name;
2023-10-19 16:56:53 +02:00
private String pid;
private String pidTypeField;
2023-10-18 17:05:39 +02:00
private String uri;
2023-10-19 16:56:53 +02:00
private String description;
private String source;
private String count;
private String path;
private String host;
private String types;
private String firstName;
private String lastName;
private String tag;
2023-10-18 17:05:39 +02:00
2023-10-19 16:56:53 +02:00
public String getId() {
2023-10-18 17:05:39 +02:00
return id;
}
2023-10-19 16:56:53 +02:00
public void setId(String id) {
2023-10-18 17:05:39 +02:00
this.id = id;
}
public String getName() {
return name;
}
2023-10-19 16:56:53 +02:00
2023-10-18 17:05:39 +02:00
public void setName(String name) {
this.name = name;
}
public String getPid() {
return pid;
}
2023-10-19 16:56:53 +02:00
2023-10-18 17:05:39 +02:00
public void setPid(String pid) {
this.pid = pid;
}
2023-10-19 16:56:53 +02:00
public String getPidTypeField() {
return pidTypeField;
2023-10-18 17:05:39 +02:00
}
2023-10-19 16:56:53 +02:00
public void setPidTypeField(String pidTypeField) {
this.pidTypeField = pidTypeField;
2023-10-18 17:05:39 +02:00
}
public String getUri() {
return uri;
}
2023-10-19 16:56:53 +02:00
2023-10-18 17:05:39 +02:00
public void setUri(String uri) {
this.uri = uri;
}
2023-10-19 16:56:53 +02:00
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getCount() {
return count;
}
public void setCount(String count) {
this.count = count;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getHost() {
return host;
2023-10-18 17:05:39 +02:00
}
2023-10-19 16:56:53 +02:00
public void setHost(String host) {
this.host = host;
2023-10-18 17:05:39 +02:00
}
2023-10-19 16:56:53 +02:00
public String getTypes() {
return types;
2023-10-18 17:05:39 +02:00
}
2023-10-19 16:56:53 +02:00
public void setTypes(String types) {
this.types = types;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
2023-10-18 17:05:39 +02:00
}
public String getTag() {
return tag;
}
2023-10-19 16:56:53 +02:00
2023-10-18 17:05:39 +02:00
public void setTag(String tag) {
this.tag = tag;
}
2023-10-26 13:38:18 +02:00
public static FetcherReference fromRemoteModel(Map<String, String> data) {
FetcherReference fetcherReference = new FetcherReference();
if (data == null) return fetcherReference;
2023-10-19 16:56:53 +02:00
2023-10-26 13:38:18 +02:00
fetcherReference.setId(data.getOrDefault("id", null));
fetcherReference.setName(data.getOrDefault("name", null));
fetcherReference.setPid(data.getOrDefault("pid", null));
fetcherReference.setPidTypeField(data.getOrDefault("pidTypeField", null));
fetcherReference.setUri(data.getOrDefault("uri", null));
fetcherReference.setDescription(data.getOrDefault("description", null));
fetcherReference.setSource(data.getOrDefault("source", null));
fetcherReference.setCount(data.getOrDefault("count", null));
fetcherReference.setPath(data.getOrDefault("path", null));
fetcherReference.setHost(data.getOrDefault("host", null));
fetcherReference.setTypes(data.getOrDefault("types", null));
fetcherReference.setFirstName(data.getOrDefault("firstName", null));
fetcherReference.setLastName(data.getOrDefault("lastName", null));
fetcherReference.setTag(data.getOrDefault("tag", null));
return fetcherReference;
}
2024-01-04 11:55:42 +01:00
// public FetcherReference fromDataRepository(DataRepository entity) {
//// this.setAbbreviation(entity.getAbbreviation());
// this.setName(entity.getLabel());
// this.setUri(entity.getUri());
// this.setId(entity.getId().toString());
// this.setPid(entity.getReference());
// String source1 = entity.getReference().substring(0, entity.getReference().indexOf(":"));
// if (source1.equals("dmp")) {
// this.source = "Internal";
// } else {
// this.source = source1;
// }
// return this;
// }
2023-10-19 16:56:53 +02:00
2024-01-04 11:55:42 +01:00
// public FetcherReference fromRegistry(Registry entity){
// this.id = entity.getId().toString();
//// this.abbreviation = entity.getAbbreviation();
//// this.created = entity.getCreated();
//// this.label = entity.getLabel();
// this.name = entity.getLabel();
//// this.modified = entity.getModified();
// this.uri = entity.getUri();
// String source1 = entity.getReference().substring(0, entity.getReference().indexOf(":"));
// if (source1.equals("dmp")) {
// this.source = "Internal";
// } else {
// this.source = source1;
2023-10-23 16:58:56 +02:00
// }
2024-01-04 11:55:42 +01:00
//// this.reference = entity.getReference();
// return this;
// }
// public FetcherReference fromService(Service entity) {
//// this.abbreviation = entity.getAbbreviation();
//// this.created = entity.getCreated();
// this.id = entity.getId().toString();
//// this.label = entity.getLabel();
// this.name = entity.getLabel();
//// this.modified = entity.getModified();
// this.uri = entity.getUri();
// String source = entity.getReference().substring(0, entity.getReference().indexOf(":"));
2023-10-23 16:58:56 +02:00
// if (source.equals("dmp")) {
2024-01-04 11:55:42 +01:00
// this.source = "Internal";
// } else {
// this.source = source;
2023-10-23 16:58:56 +02:00
// }
2024-01-04 11:55:42 +01:00
// return this;
// }
// public FetcherReference fromResearcher(Researcher entity){
// this.id = entity.getId().toString();
// this.name = entity.getLabel();
// String refParts[] = entity.getReference().split(":");
// String source = refParts[0];
//// if (source.equals("dmp")) {
//// this.key = "Internal";
//// }else {
//// this.key = source;
//// }
// return this;
// }
// public FetcherReference fromOrganisation(Organisation entity){
// this.id = entity.getId().toString();
// this.name = entity.getLabel();
// String refParts[] = entity.getReference().split(":");
// String source = refParts[0];
//// if (source.equals("dmp")) {
//// this.key = "Internal";
//// }else {
//// this.key = source;
//// }
// return this;
// }
// public FetcherReference fromDataset(ExternalDataset entity){
// this.id = entity.getId().toString();
// this.name = entity.getLabel();
// String source1 = entity.getReference().substring(0, entity.getReference().indexOf(":"));
// if (source1.equals("dmp")) {
// this.source = "Internal";
// } else {
// this.source = source1;
// }
// return this;
// }
2023-10-23 16:58:56 +02:00
2023-10-18 17:05:39 +02:00
}