Reputation: 151
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)))
Upvotes: 0
Views: 167
Reputation: 2844
Take a look at https://github.com/uwcpdx/bean-dip
Bidirectional translation between Clojure maps and Java beans that's declarative and reflection-free
Upvotes: 0
Reputation: 6666
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
Upvotes: 2