Skip to content

Commit

Permalink
Adding isFavorited support to Tweet
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinesd committed Apr 13, 2012
1 parent 13f510d commit b00214f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Expand Up @@ -74,6 +74,9 @@ public Tweet deserialize(JsonParser jp, DeserializationContext ctxt) throws IOEx
JsonNode retweetCountNode = tree.get("retweet_count");
Integer retweetCount = retweetCountNode != null && !retweetCountNode.isNull() ? retweetCountNode.getIntValue() : null;
tweet.setRetweetCount(retweetCount);
JsonNode favoritedNode = tree.get("favorited");
boolean favorited = favoritedNode != null && !favoritedNode.isNull() ? favoritedNode.getBooleanValue() : false;
tweet.setFavorited(favorited);
jp.skipChildren();
return tweet;
}
Expand Down
Expand Up @@ -33,6 +33,7 @@ public class Tweet {
private Long toUserId;
private Long inReplyToStatusId;
private long fromUserId;
private boolean favorited;
private String languageCode;
private String source;
private Integer retweetCount;
Expand Down Expand Up @@ -141,4 +142,18 @@ public void setRetweetCount(Integer retweetCount) {
public Integer getRetweetCount() {
return retweetCount;
}

/**
* @return the favorited
*/
public boolean isFavorited() {
return favorited;
}

/**
* @param favorited the favorited to set
*/
public void setFavorited(boolean favorited) {
this.favorited = favorited;
}
}

0 comments on commit b00214f

Please sign in to comment.