package at.gv.egiz.moazs.preprocess; import at.gv.zustellung.app2mzs.xsd.ConfigType; import org.springframework.stereotype.Component; import java.util.Map; import static at.gv.zustellung.app2mzs.xsd.ServerType.serverTypeBuilder; @Component public class MapToConfigConverter { private static final String TNVZ_REQUEST_KEY = "perform-query-person-request"; private static final String MSG_URL_KEY = "msg.url"; public ConfigType convert(Map values) { var server = serverTypeBuilder() .withZUSEUrlID(values.get(MSG_URL_KEY)) .build(); Boolean performQueryPersonRequest = values.get(TNVZ_REQUEST_KEY) == null ? null : Boolean.getBoolean(values.get(TNVZ_REQUEST_KEY)); return ConfigType.configTypeBuilder() .withPerformQueryPersonRequest(performQueryPersonRequest) .withServer(server) .build(); } }