diff --git a/elx-common/src/main/java/org/xbib/elx/common/ClientBuilder.java b/elx-common/src/main/java/org/xbib/elx/common/ClientBuilder.java index 6e4fca4..6816713 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/ClientBuilder.java +++ b/elx-common/src/main/java/org/xbib/elx/common/ClientBuilder.java @@ -14,6 +14,7 @@ import org.xbib.elx.api.BasicClient; import org.xbib.elx.api.SearchClientProvider; import java.io.IOException; +import java.util.Map; import java.util.ServiceLoader; @SuppressWarnings("rawtypes") @@ -106,6 +107,25 @@ public class ClientBuilder { return this; } + public ClientBuilder put(Map map) { + for (Map.Entry entry : map.entrySet()) { + if (entry.getValue() == null) { + continue; + } + if (entry.getValue() instanceof String || + entry.getValue() instanceof Integer || + entry.getValue() instanceof Long || + entry.getValue() instanceof Float || + entry.getValue() instanceof TimeValue) { + settingsBuilder.put(entry.getKey(), entry.getValue().toString()); + } else { + logger.log(Level.WARN, "skipping " + entry.getValue() + + " because invalid class type " + entry.getValue().getClass().getName()); + } + } + return this; + } + @SuppressWarnings("unchecked") public C build() throws IOException { Settings settings = settingsBuilder.build(); diff --git a/gradle.properties b/gradle.properties index ee6d2fb..8df8c01 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ xbib-netty-http.version = 4.1.49.0 elasticsearch.version = 2.2.1 jackson.version = 2.9.10 jna.version = 4.5.2 -log4j.version = 2.12.1 +log4j.version = 2.13.1 mustache.version = 0.9.5 jts.version = 1.13 junit.version = 5.6.2