package eu.eudat.models.rda.mapper; import com.fasterxml.jackson.databind.JsonNode; import eu.eudat.models.rda.TechnicalResource; public class TechnicalResourceRDAMapper { public static TechnicalResource toRDA(JsonNode structure, JsonNode properties) { TechnicalResource rda = new TechnicalResource(); String rdaProperty = structure.get("rdaProperty").asText(); String value = properties.get(structure.get("id").asText()).asText(); if (rdaProperty.contains("description")) { rda.setDescription(value); } else if (rdaProperty.contains("name")) { rda.setName(value); } return rda; } }