Some Java classes expect arguments of the type java.util.Properties
, for example HikariCP. Currently I need to construct these manually:
{:dataSourceProperties
(doto (java.util.Properties.)
(.putAll {"socketTimeout" "30" }))}
it would be nice if I could instead just provide a map and it got converted to Properties automatically:
{:dataSourceProperties {"socketTimeout" "30" }}
Properties is a built-in JVM class used regularly to it seems fitting to have built-in support for it.
Adding something like this would suffice:
(defmethod j/to-java [java.util.Properties clojure.lang.APersistentMap] [_ props]
(doto (java.util.Properties.) (.putAll props)))