質問

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?

役に立ちましたか?

解決

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

for (Reference friend : friends) {
    System.out.println(friend.getName());
}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top