(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 <[email protected]>
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 {
>
>     public static List<User> getUsers() {
>         List<User> userList = new ArrayList<User>();
>         User user = new User("Mike");
>         userList.add(user);
>         return userList;
>     }
> }
>
> public class User {
>
>     private String name;
>
>     public User(String name) {
>         this.name = name;
>     }
> }
>
> In a clojure project I'm not fully sure how to retrieve the call to the
> list of Users and just print out the name of the User I've created here
> Mike. I have searched online under the keywords "clojure java interop
> java.util.ArrayList", but I can only find examples where in clojure you
> create a new arraylist instance and do operations on this newly created
> list. How does clojure deal with an ArrayList that is being passed into
> clojure from java?
>
> Thanks,
> Adrian.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to [email protected]
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to