244 lines
6.8 KiB
Java
244 lines
6.8 KiB
Java
package eu.eudat.models.data;
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
public class FetcherReference {
|
|
|
|
private String id;
|
|
private String name;
|
|
private String pid;
|
|
private String pidTypeField;
|
|
private String uri;
|
|
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;
|
|
|
|
public String getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(String id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public void setName(String name) {
|
|
this.name = name;
|
|
}
|
|
|
|
public String getPid() {
|
|
return pid;
|
|
}
|
|
|
|
public void setPid(String pid) {
|
|
this.pid = pid;
|
|
}
|
|
|
|
public String getPidTypeField() {
|
|
return pidTypeField;
|
|
}
|
|
|
|
public void setPidTypeField(String pidTypeField) {
|
|
this.pidTypeField = pidTypeField;
|
|
}
|
|
|
|
public String getUri() {
|
|
return uri;
|
|
}
|
|
|
|
public void setUri(String uri) {
|
|
this.uri = uri;
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
public void setHost(String host) {
|
|
this.host = host;
|
|
}
|
|
|
|
public String getTypes() {
|
|
return types;
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
public String getTag() {
|
|
return tag;
|
|
}
|
|
|
|
public void setTag(String tag) {
|
|
this.tag = tag;
|
|
}
|
|
|
|
public static FetcherReference fromRemoteModel(Map<String, String> data) {
|
|
FetcherReference fetcherReference = new FetcherReference();
|
|
if (data == null) return fetcherReference;
|
|
|
|
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;
|
|
}
|
|
|
|
// 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;
|
|
// }
|
|
|
|
// 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;
|
|
// }
|
|
//// 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(":"));
|
|
// if (source.equals("dmp")) {
|
|
// this.source = "Internal";
|
|
// } else {
|
|
// this.source = source;
|
|
// }
|
|
// 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;
|
|
// }
|
|
|
|
}
|