is there a way to create java objects from Clojure maps? something where the following would hold - (= my-map (bean (convert-to-object my-map)))
2 Answers
You would need to tell it what type of Java object you wanted to create. Take a look at the org.clojure/java.data Contrib library which can build Java objects from hash maps (via constructors, via property setters, via builders): https://github.com/clojure/java.data
Comments
Take a look at https://github.com/uwcpdx/bean-dip
Bidirectional translation between Clojure maps and Java beans that's declarative and reflection-free