0

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?

Maksym Demidas
  • 7,707
  • 1
  • 29
  • 36
IceNine
  • 205
  • 2
  • 5
  • 12
  • A list holds multiple items, like an array. You will need to loop through the list and print each item in the list individually. – Tricky12 Aug 12 '13 at 18:19

1 Answers1

2

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

for (Reference friend : friends) {
    System.out.println(friend.getName());
}
Daniel S.
  • 6,458
  • 4
  • 35
  • 78
  • Thank you, this was it. I was doing this before but i was trying to print out "friends" and that didnt have a .getName() but now i realize i had to print out friend.getName(); – IceNine Aug 12 '13 at 18:32