简体   繁体   中英

Flickrj - getPublicGroups uncommon return type

Reading the docs for Flickrj 1.2

http://flickrj.sourceforge.net/api/com/aetrion/flickr/people/PeopleInterface.html#getPublicGroups(java.lang.String)

I'm trying to the public groups for users but it seems the return type is java.util.Collection

public java.util.Collection getPublicGroups(java.lang.String userId)

And I'm stumped as to how I can get the group names for a user. If I print the output for

people.getPublicGroups(userID);

I get:

[com.aetrion.flickr.groups.Group@3f1179, com.aetrion.flickr.groups.Group@945b95.... etc

It's not what I'm after and I'm stuck.

I've solved it.

The Collection the method getPublicgroups returned was a collection of Groups.

So I assigned the collection to a collection type. Used an iterator to loop the elements in the collection and casted each element to the Group class.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM