Created
July 2, 2011 09:07
-
-
Save yusuke/1059878 to your computer and use it in GitHub Desktop.
FutureStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2007 Yusuke Yamamoto | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, | |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
* See the License for the specific language governing permissions and | |
* limitations under the License. | |
*/ | |
package twitter4j; | |
import twitter4j.internal.http.HttpResponse; | |
import twitter4j.internal.json.Factory; | |
import java.util.Date; | |
/** | |
* @author Yusuke Yamamoto - yusuke at mac.com | |
* @since Twitter4J 2.2.4 | |
*/ | |
class FutureStatus implements Status{ | |
HttpResponse res; | |
Factory JSONImplFactory; | |
Status status = null; | |
FutureStatus(HttpResponse res, Factory JSONImplFactory){ | |
this.res = res; | |
this.JSONImplFactory = JSONImplFactory; | |
} | |
private Status getStatus(){ | |
if(status == null){ | |
try { | |
status = JSONImplFactory.createStatus(res); | |
} catch (TwitterException e) { | |
throw new RuntimeException(e); | |
} | |
} | |
return status; | |
} | |
public Date getCreatedAt() { | |
return getStatus().getCreatedAt(); | |
} | |
public long getId() { | |
return getStatus().getId(); | |
} | |
public String getText() { | |
return getStatus().getText(); | |
} | |
public String getSource() { | |
return getStatus().getSource(); | |
} | |
public boolean isTruncated() { | |
return getStatus().isTruncated(); | |
} | |
public long getInReplyToStatusId() { | |
return getStatus().getInReplyToStatusId(); | |
} | |
public long getInReplyToUserId() { | |
return getStatus().getInReplyToUserId(); | |
} | |
public String getInReplyToScreenName() { | |
return getStatus().getInReplyToScreenName(); | |
} | |
public GeoLocation getGeoLocation() { | |
return getStatus().getGeoLocation(); | |
} | |
public Place getPlace() { | |
return getStatus().getPlace(); | |
} | |
public boolean isFavorited() { | |
return getStatus().isFavorited(); | |
} | |
public User getUser() { | |
return getStatus().getUser(); | |
} | |
public boolean isRetweet() { | |
return getStatus().isRetweet(); | |
} | |
public Status getRetweetedStatus() { | |
return getStatus().getRetweetedStatus(); | |
} | |
public long[] getContributors() { | |
return getStatus().getContributors(); | |
} | |
public long getRetweetCount() { | |
return getStatus().getRetweetCount(); | |
} | |
public boolean isRetweetedByMe() { | |
return getStatus().isRetweetedByMe(); | |
} | |
public UserMentionEntity[] getUserMentionEntities() { | |
return getStatus().getUserMentionEntities(); | |
} | |
public URLEntity[] getURLEntities() { | |
return getStatus().getURLEntities(); | |
} | |
public HashtagEntity[] getHashtagEntities() { | |
return getStatus().getHashtagEntities(); | |
} | |
public Annotations getAnnotations() { | |
return getStatus().getAnnotations(); | |
} | |
public MediaEntity[] getMediaEntities() { | |
return getStatus().getMediaEntities(); | |
} | |
public int compareTo(Status status) { | |
return getStatus().compareTo(status); | |
} | |
public RateLimitStatus getRateLimitStatus() { | |
return getStatus().getRateLimitStatus(); | |
} | |
public int getAccessLevel() { | |
return getStatus().getAccessLevel(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment