}
return null;
}
static PersistentVector fromRubyArray(ThreadContext context, RubyArray ruby_array) {
Var var = DiametricService.getFn("clojure.core", "vector");
PersistentVector clj_tx_data = (PersistentVector)var.invoke();
Var adder = DiametricService.getFn("clojure.core", "conj");
for (int i=0; i<ruby_array.getLength(); i++) {
Object element = ruby_array.get(i);
if (element instanceof RubyHash) {
APersistentMap map = fromRubyHash(context, (RubyHash)element);
clj_tx_data = (PersistentVector)adder.invoke(clj_tx_data, map);
} else if (element instanceof RubyArray) {
PersistentVector vector = fromRubyArray(context, (RubyArray)element);
clj_tx_data = (PersistentVector)adder.invoke(clj_tx_data, vector);
} else if (element instanceof IRubyObject) {
clj_tx_data =
(PersistentVector)adder.invoke(clj_tx_data, DiametricUtils.convertRubyToJava(context, (IRubyObject)element));
} else if (element instanceof String) {
clj_tx_data = (PersistentVector)adder.invoke(clj_tx_data, getStringOrUUID((String)element));
} else {
clj_tx_data = (PersistentVector)adder.invoke(clj_tx_data, element);
}
}
return clj_tx_data;
}