Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add RateLimitStatus#getRemainingHits() for the better migration exper…

…ience from 2.2.x
  • Loading branch information...
commit 7adffe3cfd237d12e0b0098dfaf79cb2227f74cd 1 parent b9f1fb0
@yusuke authored
View
10 twitter4j-appengine/src/main/java/twitter4j/internal/json/LazyQueryResult.java
@@ -116,4 +116,14 @@ public String toString() {
"target=" + getTarget() +
"}";
}
+
+ @Override
+ public RateLimitStatus getRateLimitStatus() {
+ return getTarget().getRateLimitStatus();
+ }
+
+ @Override
+ public int getAccessLevel() {
+ return getTarget().getAccessLevel();
+ }
}
View
14 twitter4j-core/src/main/java/twitter4j/RateLimitStatus.java
@@ -25,15 +25,25 @@
public interface RateLimitStatus extends java.io.Serializable {
/**
* Returns the remaining number of API requests available.<br>
- * This value is identical to the &quot;X-RateLimit-Remaining&quot; response header.
+ * This value is identical to the &quot;X-Rate-Limit-Remaining&quot; response header.
*
* @return the remaining number of API requests available
+ * @since Twitter4J 3.0.0
*/
int getRemaining();
/**
+ * Returns the remaining number of API requests available.<br>
+ * This value is identical to the &quot;X-Rate-Limit-Remaining&quot; response header.
+ *
+ * @return the remaining number of API requests available
+ * @deprecated use {@link #getRemaining()} instead
+ */
+ int getRemainingHits();
+
+ /**
* Returns the current limit in effect<br>
- * This value is identical to the &quot;X-RateLimit-Limit&quot; response header.
+ * This value is identical to the &quot;X-Rate-Limit-Limit&quot; response header.
*
* @return the current limit in effect
*/
View
8 twitter4j-core/src/main/java/twitter4j/internal/json/RateLimitStatusJSONImpl.java
@@ -132,6 +132,14 @@ public int getRemaining() {
* {@inheritDoc}
*/
@Override
+ public int getRemainingHits() {
+ return getRemaining();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
public int getLimit() {
return limit;
}
Please sign in to comment.
Something went wrong with that request. Please try again.