In Clojure I want to interop to use:
JestClientFactory factory = new JestClientFactory();
factory.setHttpClientConfig(new HttpClientConfig
.Builder("http://localhost:9200")
.build());
So I wrote some code like so:
(:import (io.searchbox.client JestClientFactory)
(io.searchbox.client.config HttpClientConfig$Builder))
(let [factory (JestClientFactory.)
http-client-config (-> (HttpClientConfig$Builder "http://localhost:9200")
(.build))])
But I am getting the following error when building the jar
Expecting var, but HttpClientConfig$Builder is mapped to class io.searchbox.client.config.HttpClientConfig$Builder
Any help would be great.
You lack the .
behind HttpClientConfig$Builder
. Your code does a static call on a class basically. You need the new
from your example.
(-> (HttpClientConfig$Builder. "http://localhost:9200") ; note the `.`
(.build))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With