Re: Java Interop for a static method call that returns an ArrayList

2016-02-10 Thread Jeremy Heiler
On Wed, Feb 10, 2016 at 8:43 AM, Adrian Cooley wrote: > > How does clojure deal with an ArrayList that is being passed into clojure > from java? > The trick is to not think in terms of specific classes, but in terms of the different Java-related things you can do. See: http://clojure.org/referen

Re: Java Interop for a static method call that returns an ArrayList

2016-02-10 Thread Adrian Cooley
Thanks a million Gary, this has been extremely helpful. I'm from an object oriented background and I'm having the usual problems of crossing into the functional thinking land, hence the straightforward question. I appreciate the help, it worked exactly as you've outlined below, Thanks, Adrian.

Re: Java Interop for a static method call that returns an ArrayList

2016-02-10 Thread Gary Trakhman
(map (fn [u] (.getName u)) (DAO/getUsers)) ? You'll need to write a getter since name is private. On Wed, Feb 10, 2016 at 8:44 AM Adrian Cooley wrote: > Hi, > > I have a Java class that has a static method call that returns a Java > Array List of users as follows: > > public final class DAO { >

Java Interop for a static method call that returns an ArrayList

2016-02-10 Thread Adrian Cooley
Hi, I have a Java class that has a static method call that returns a Java Array List of users as follows: public final class DAO { public static List getUsers() { List userList = new ArrayList(); User user = new User("Mike"); userList.add(user); return userLi