Reputation: 1494
I have a .java file that will be called for its public String solve()
method to answer a problem. The method receives project-defined Java class RP, which contains a collection of RF, which each contain a collection of RO, which each contain several RA which, finally, boil down to String, String pairs (a name and a value). My question is, (how) can I have that solve() method pass its RP object to Clojure where I believe I can do all the work to generate a solution more effectively, and eventually return a String solution back?
EDIT: What I'm looking for is some way of saying, String answer = toClojure(RP);
and in Clojure I'll be able to do the equivalent of RP.getRF().getRO().getRA().getName(), where each of these functions is defined in the Java classes.
Upvotes: 0
Views: 244
Reputation: 92117
Just pass it the object reference, same as you would pass it to a java method. Clojure doesn't need any special magic to receive java objects.
Upvotes: 2