Merge remote-tracking branch 'origin/master' into setuptests · JavaLeaks/Flickr4Java@c4354a9 · GitHub
Skip to content

Commit c4354a9

Browse files
committed
Merge remote-tracking branch 'origin/master' into setuptests
2 parents 677d95a + c00ae71 commit c4354a9

49 files changed

Lines changed: 2373 additions & 68 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Flickr4Java/src/main/java/com/flickr4java/flickr/Flickr.java

Lines changed: 31 additions & 0 deletions
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.flickr4java.flickr.contacts;
2+
3+
import com.flickr4java.flickr.SearchResultList;
4+
5+
6+
public class ContactList<E> extends SearchResultList<Contact> {
7+
8+
// (avoid compiler warning)
9+
private static final long serialVersionUID = -4735611134085303463L;
10+
11+
}

Flickr4Java/src/main/java/com/flickr4java/flickr/contacts/ContactsInterface.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public ContactsInterface(String apiKey, String sharedSecret, Transport transport
5050
* @return The Collection of Contact objects
5151
*/
5252
public Collection<Contact> getList() throws FlickrException {
53-
List<Contact> contacts = new ArrayList<Contact>();
54-
53+
ContactList<Contact> contacts = new ContactList<Contact>();
54+
5555
Map<String, Object> parameters = new HashMap<String, Object>();
5656
parameters.put("method", METHOD_GET_LIST);
5757

@@ -61,6 +61,10 @@ public Collection<Contact> getList() throws FlickrException {
6161
}
6262

6363
Element contactsElement = response.getPayload();
64+
contacts.setPage(contactsElement.getAttribute("page"));
65+
contacts.setPages(contactsElement.getAttribute("pages"));
66+
contacts.setPerPage(contactsElement.getAttribute("perpage"));
67+
contacts.setTotal(contactsElement.getAttribute("total"));
6468
NodeList contactNodes = contactsElement.getElementsByTagName("contact");
6569
for (int i = 0; i < contactNodes.getLength(); i++) {
6670
Element contactElement = (Element) contactNodes.item(i);
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package com.flickr4java.flickr.groups;
2+
3+
public class Blast {
4+
5+
private String dateBlastAdded;
6+
7+
private String userId;
8+
9+
private String blast;
10+
11+
/**
12+
* Unix timestamp formatted date
13+
*
14+
* @return date blast was added
15+
*/
16+
public String getDateBlastAdded() {
17+
return dateBlastAdded;
18+
}
19+
20+
public void setDateBlastAdded(String dateBlastAdded) {
21+
this.dateBlastAdded = dateBlastAdded;
22+
}
23+
24+
/**
25+
* Blaster's user_id
26+
*
27+
* @return user_id
28+
*/
29+
public String getUserId() {
30+
return userId;
31+
}
32+
33+
public void setUserId(String userId) {
34+
this.userId = userId;
35+
}
36+
37+
/**
38+
* Text of the blast
39+
*
40+
* @return blast text
41+
*/
42+
public String getBlast() {
43+
return blast;
44+
}
45+
46+
public void setBlast(String blast) {
47+
this.blast = blast;
48+
}
49+
50+
}

Flickr4Java/src/main/java/com/flickr4java/flickr/groups/Group.java

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ public class Group implements BuddyIconable {
1919
private String name;
2020

2121
private int members;
22+
23+
private int poolCount;
24+
25+
private int topicCount;
2226

2327
private String privacy;
2428

@@ -29,6 +33,10 @@ public class Group implements BuddyIconable {
2933
private String description;
3034

3135
private Throttle throttle;
36+
37+
private Blast blast;
38+
39+
private Restriction restriction;
3240

3341
private String lang;
3442

@@ -87,6 +95,42 @@ public void setMembers(String members) {
8795
System.out.println("trace: Group.setMembers(String) encountered a number format " + "exception. members set to 0");
8896
}
8997
}
98+
public int getPoolCount() {
99+
return poolCount;
100+
}
101+
102+
public void setPoolCount(int poolCount) {
103+
this.poolCount = poolCount;
104+
}
105+
106+
public void setPoolCount(String poolCount) {
107+
try {
108+
if (poolCount != null)
109+
setPoolCount(Integer.parseInt(poolCount));
110+
} catch (NumberFormatException nfe) {
111+
setPoolCount(0);
112+
if (Flickr.tracing)
113+
System.out.println("trace: Group.setPoolCount(String) encountered a number format " + "exception. poolCount set to 0");
114+
}
115+
}
116+
public int getTopicCount() {
117+
return topicCount;
118+
}
119+
120+
public void setTopicCount(int topicCount) {
121+
this.topicCount = topicCount;
122+
}
123+
124+
public void setTopicCount(String topicCount) {
125+
try {
126+
if (topicCount != null)
127+
setTopicCount(Integer.parseInt(topicCount));
128+
} catch (NumberFormatException nfe) {
129+
setPoolCount(0);
130+
if (Flickr.tracing)
131+
System.out.println("trace: Group.setTopicCount(String) encountered a number format " + "exception. topicCount set to 0");
132+
}
133+
}
90134

91135
/**
92136
* @deprecated
@@ -188,15 +232,15 @@ public int getPhotoCount() {
188232
}
189233

190234
/**
191-
* @deprecated
235+
*
192236
* @param photoCount
193237
*/
194238
public void setPhotoCount(int photoCount) {
195239
this.photoCount = photoCount;
196240
}
197241

198242
/**
199-
* @deprecated
243+
*
200244
* @param photoCount
201245
*/
202246
public void setPhotoCount(String photoCount) {
@@ -313,6 +357,22 @@ public Throttle getThrottle() {
313357
public void setThrottle(Throttle throttle) {
314358
this.throttle = throttle;
315359
}
360+
361+
public Blast getBlast() {
362+
return blast;
363+
}
364+
365+
public void setBlast(Blast blast) {
366+
this.blast = blast;
367+
}
368+
369+
public Restriction getRestriction() {
370+
return restriction;
371+
}
372+
373+
public void setRestriction(Restriction restriction) {
374+
this.restriction = restriction;
375+
}
316376

317377
/**
318378
* @return the invitationOnly

Flickr4Java/src/main/java/com/flickr4java/flickr/groups/GroupsInterface.java

Lines changed: 33 additions & 0 deletions

0 commit comments

Comments
 (0)