Search code examples
facebookspringspring-socialspring-social-facebook

How To Print Out A <List>Reference object in java?


I am using spring social api to create a facebook application. I am using List<Reference> friends = facebook.friendOperations().getFriends(); to get a list of my friends. I want to print out the list but when i do it just prints out

[org.springframework.social.facebook.api.Reference@7606931d,

I have tried using the

@Override
public String toString() {
    return ToStringBuilder.reflectionToString(this);
}

But it still just prints out the references. Is there anyway to print out what i need?


Solution

  • Loop through the list of references, and print each of them individually, like this:

    for (Reference friend : friends) {
        System.out.println(friend.getName());
    }