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 structure, JsonNode properties) { License rda = new License(); String rdaProperty = structure.get("rdaProperty").asText(); String value = properties.get(structure.get("id").asText()).asText(); if (rdaProperty.contains("license_ref")) { rda.setLicenseRef(URI.create(value)); } else if (rdaProperty.contains("start_date")) { rda.setStartDate(value); } return rda; } }