24 lines
546 B
Java
24 lines
546 B
Java
package eu.eudat.models.rda.mapper;
|
|
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
import eu.eudat.models.rda.License;
|
|
|
|
import java.net.URI;
|
|
|
|
public class LicenseRDAMapper {
|
|
|
|
public static License toRDA(JsonNode node) {
|
|
License rda = new License();
|
|
String rdaProperty = node.get("rdaProperty").asText();
|
|
String value = node.get("value").asText();
|
|
|
|
if (rdaProperty.contains("license_ref")) {
|
|
rda.setLicenseRef(URI.create(value));
|
|
} else if (rdaProperty.contains("start_date")) {
|
|
rda.setStartDate(value);
|
|
}
|
|
|
|
return rda;
|
|
}
|
|
}
|