Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

Commit

Permalink
javadoc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuke committed Apr 18, 2010
1 parent 0b7831f commit c4e93bc
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 44 deletions.
8 changes: 4 additions & 4 deletions twitter4j-core/src/main/java/twitter4j/AsyncTwitter.java
Expand Up @@ -77,7 +77,7 @@ public class AsyncTwitter extends TwitterOAuthSupportBase implements java.io.Ser
* @param screenName screen name
* @param password password
* @param listener listener
* @deprecated use new AsyncTwitterFactory.getBasicAuthorizedInstance() instead.
* @deprecated use {@link AsyncTwitterFactory#getInstance(String,String)} instead.
*/
public AsyncTwitter(String screenName, String password, TwitterListener listener) {
super(ConfigurationContext.getInstance(), screenName, password);
Expand Down Expand Up @@ -1726,7 +1726,7 @@ public AccessToken getOAuthAccessToken(RequestToken requestToken, String oauthVe

/**
* {@inheritDoc}
* @deprecated Use TwitterFactory.getInstance(AccessToken accessToken)
* @deprecated Use {@link AsyncTwitterFactory#getInstance(Authorization)}
*/
@Override
public void setOAuthAccessToken(AccessToken accessToken) {
Expand All @@ -1735,7 +1735,7 @@ public void setOAuthAccessToken(AccessToken accessToken) {

/**
* {@inheritDoc}
* @deprecated Use TwitterFactory.getInstance(AccessToken accessToken)
* @deprecated Use {@link AsyncTwitterFactory#getInstance(Authorization)}
*/
@Override
public AccessToken getOAuthAccessToken(String token, String tokenSecret) throws TwitterException {
Expand All @@ -1757,7 +1757,7 @@ public AccessToken getOAuthAccessToken(String token, String tokenSecret, String
* @param tokenSecret access token secret
* @throws IllegalStateException when AccessToken has already been retrieved or set
* @since Twitter 2.0.0
* @deprecated Use Twitter getInstance(AccessToken accessToken)
* @deprecated Use {@link AsyncTwitterFactory#getInstance(Authorization)}
*/
@Override
public void setOAuthAccessToken(String token, String tokenSecret) {
Expand Down
6 changes: 3 additions & 3 deletions twitter4j-core/src/main/java/twitter4j/TimeSpanUtil.java
Expand Up @@ -42,22 +42,22 @@ private TimeSpanUtil() {
}

/**
* @deprecated use twitter4j.util.TimeSpanUtil instead.
* @deprecated use {@link twitter4j.util.TimeSpanUtil#toTimeSpanString(java.util.Date)} instead.
*/
public static String toTimeSpanString(Date date) {
return toTimeSpanString(date.getTime());
}

/**
* @deprecated use twitter4j.util.TimeSpanUtil instead.
* @deprecated use {@link twitter4j.util.TimeSpanUtil#toTimeSpanString(long)} instead.
*/
public static String toTimeSpanString(long milliseconds) {
int deltaInSeconds = (int) ((System.currentTimeMillis() - milliseconds) / 1000);
return toTimeSpanString(deltaInSeconds);
}

/**
* @deprecated use twitter4j.util.TimeSpanUtil instead.
* @deprecated use {@link twitter4j.util.TimeSpanUtil#toTimeSpanString(int)} instead.
*/
public static String toTimeSpanString(int deltaInSeconds) {
if (deltaInSeconds < 5) {
Expand Down
10 changes: 5 additions & 5 deletions twitter4j-core/src/main/java/twitter4j/Twitter.java
Expand Up @@ -82,7 +82,7 @@ public class Twitter extends TwitterOAuthSupportBase
/**
* Creates an unauthenticated Twitter instance
*
* @deprecated use TwitterFactory.getInstance() instead
* @deprecated use {@link TwitterFactory#getInstance()} instead
*/
public Twitter() {
super(ConfigurationContext.getInstance());
Expand All @@ -93,7 +93,7 @@ public Twitter() {
*
* @param screenName the screen name of the user
* @param password the password of the user
* @deprecated use TwitterFactory.getInstance(screenName, password) instead
* @deprecated use {@link TwitterFactory#getInstance(String,String)} instead
*/
public Twitter(String screenName, String password) {
super(ConfigurationContext.getInstance(), screenName, password);
Expand Down Expand Up @@ -1663,15 +1663,15 @@ public synchronized AccessToken getOAuthAccessToken(RequestToken requestToken, S

/**
* {@inheritDoc}
* @deprecated Use TwitterFactory.getInstance(AccessToken accessToken)
* @deprecated Use {@link TwitterFactory#getInstance(twitter4j.http.Authorization)} instead
*/
public synchronized void setOAuthAccessToken(AccessToken accessToken) {
getOAuth().setOAuthAccessToken(accessToken);
}

/**
* {@inheritDoc}
* @deprecated Use TwitterFactory.getInstance(AccessToken accessToken)
* @deprecated Use {@link TwitterFactory#getInstance(twitter4j.http.Authorization)} instead
*/
public synchronized AccessToken getOAuthAccessToken(String token, String tokenSecret) throws TwitterException {
return getOAuth().getOAuthAccessToken(new RequestToken(token, tokenSecret));
Expand All @@ -1692,7 +1692,7 @@ public synchronized AccessToken getOAuthAccessToken(String token
* @param tokenSecret access token secret
* @throws IllegalStateException when AccessToken has already been retrieved or set
* @since Twitter 2.0.0
* @deprecated Use Twitter getInstance(AccessToken accessToken)
* @deprecated Use {@link TwitterFactory#getInstance(twitter4j.http.Authorization)} instead
*/
public void setOAuthAccessToken(String token, String tokenSecret) {
getOAuth().setOAuthAccessToken(new AccessToken(token, tokenSecret));
Expand Down
Expand Up @@ -78,7 +78,7 @@ private void readObject(ObjectInputStream stream)
* @param consumerSecret OAuth consumer secret
* @since Twitter 2.0.0
* @throws IllegalStateException when OAuth consumer has already been set, or the instance is using basic authorization
* @deprecated Use TwitterFactory.getInstance(String consumerKey, String consumerSecret)
* @deprecated Use {@link TwitterFactory#getInstance(twitter4j.conf.Configuration, twitter4j.http.Authorization)} instead
*/
public abstract void setOAuthConsumer(String consumerKey, String consumerSecret);

Expand Down Expand Up @@ -110,7 +110,7 @@ private void readObject(ObjectInputStream stream)
* @see <a href="http://apiwiki.twitter.com/OAuth-FAQ#Howlongdoesanaccesstokenlast">Twitter API Wiki - How long does an access token last?</a>
* @see <a href="http://oauth.net/core/1.0a/#auth_step2">OAuth Core 1.0a - 6.2. Obtaining User Authorization</a>
* @since Twitter 2.0.8
* @deprecated Use getOAuthAccessToken(RequestToken requestToken, String oauthVerifier)
* @deprecated Use {@link #getOAuthAccessToken(twitter4j.http.RequestToken, String)} instead
*/
public abstract AccessToken getOAuthAccessToken(String token
, String tokenSecret, String pin) throws TwitterException;
Expand All @@ -121,7 +121,7 @@ public abstract AccessToken getOAuthAccessToken(String token
* @param token access token
* @param tokenSecret access token secret
* @since Twitter 2.0.0
* @deprecated Use Twitter getInstance(AccessToken accessToken)
* @deprecated Use {@link TwitterFactory#getInstance(twitter4j.http.Authorization)} instead
* @throws IllegalStateException when AccessToken has already been retrieved or set
*/
public abstract void setOAuthAccessToken(String token, String tokenSecret);
Expand Down
14 changes: 6 additions & 8 deletions twitter4j-core/src/main/java/twitter4j/TwitterStream.java
Expand Up @@ -35,12 +35,10 @@
import twitter4j.internal.logging.Logger;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
* A java reporesentation of the <a href="http://apiwiki.twitter.com/Streaming-API-Documentation">Twitter Streaming API</a><br>
* A java representation of the <a href="http://apiwiki.twitter.com/Streaming-API-Documentation">Twitter Streaming API</a><br>
* Note that this class is NOT compatible with Google App Engine as GAE is not capable of handling requests longer than 30 seconds.
*
* @author Yusuke Yamamoto - yusuke at mac.com
Expand All @@ -58,7 +56,7 @@ public final class TwitterStream extends TwitterBase implements java.io.Serializ
/**
* Constructs a TwitterStream instance. UserID and password should be provided by either twitter4j.properties or system property.
* since Twitter4J 2.0.10
* @deprecated use new TwitterStreamFactory.getInstance() instead.
* @deprecated use {@link TwitterStreamFactory#getInstance()} instead.
*/
public TwitterStream() {
super(ConfigurationContext.getInstance());
Expand All @@ -71,7 +69,7 @@ public TwitterStream() {
* since Twitter4J 2.0.10
* @param screenName screen name
* @param password password
* @deprecated use new TwitterStreamFactory.getInstance() instead.
* @deprecated use {@link TwitterStreamFactory#getInstance()} instead.
*/
public TwitterStream(String screenName, String password) {
super(ConfigurationContext.getInstance(), screenName, password);
Expand All @@ -85,7 +83,7 @@ public TwitterStream(String screenName, String password) {
* @param screenName screen name
* @param password password
* @param listener listener
* @deprecated use new TwitterStreamFactory.getInstance() instead.
* @deprecated use {@link TwitterStreamFactory#getInstance()} instead.
*/
public TwitterStream(String screenName, String password, StatusListener listener) {
super(ConfigurationContext.getInstance(), screenName, password);
Expand Down Expand Up @@ -299,7 +297,7 @@ public StatusStream getFilterStream(FilterQuery query) throws TwitterException {
* @see twitter4j.StatusStream
* @see <a href="http://apiwiki.twitter.com/Streaming-API-Documentation#statuses/filter">Twitter API Wiki / Streaming API Documentation - filter</a>
* @since Twitter4J 2.0.10
* @deprecated use #filter(FilterQuery) instead
* @deprecated use {@link #filter(FilterQuery)} instead
*/
public void filter(final int count, final int[] follow, final String[] track) {
startHandler(new StreamHandlingThread() {
Expand All @@ -319,7 +317,7 @@ public StatusStream getStream() throws TwitterException {
* @see twitter4j.StatusStream
* @see <a href="http://apiwiki.twitter.com/Streaming-API-Documentation#statuses/filter">Twitter API Wiki / Streaming API Documentation - filter</a>
* @since Twitter4J 2.0.10
* @deprecated use #getFilterStream(FilterQuery) instead
* @deprecated use {@link #getFilterStream(FilterQuery)} instead
*/
public StatusStream getFilterStream(int count, int[] follow, String[] track)
throws TwitterException {
Expand Down
18 changes: 9 additions & 9 deletions twitter4j-core/src/main/java/twitter4j/User.java
Expand Up @@ -118,61 +118,61 @@ public interface User extends Comparable<User>, TwitterResponse, java.io.Seriali
/**
* @return created_at or null if the user is protected
* @since Twitter4J 1.1.0
* @deprecated use getStatus().getCreatedAt()
* @deprecated Use {@link #getStatus()}{@link twitter4j.Status#getCreatedAt() .getCreatedAt()}
*/
Date getStatusCreatedAt();

/**
* @return status id or -1 if the user is protected
* @deprecated use getStatus().getId()
* @deprecated Use {@link #getStatus()}{@link twitter4j.Status#getId() .getId()}
*/
long getStatusId();

/**
* @return status text or null if the user is protected
* @deprecated use getStatus().getText()
* @deprecated Use {@link #getStatus()}{@link twitter4j.Status#getText() .getText()}
*/
String getStatusText();

/**
* @return source or null if the user is protected
* @since 1.1.4
* @deprecated use getStatus().getSource()
* @deprecated Use {@link #getStatus()}{@link twitter4j.Status#getSource() .getSource()}
*/
String getStatusSource();

/**
* @return truncated or false if the user is protected
* @since 1.1.4
* @deprecated use getStatus().isTruncated()
* @deprecated Use {@link #getStatus()}{@link twitter4j.Status#isTruncated() .isTruncated()}
*/
boolean isStatusTruncated();

/**
* @return in_reply_to_status_id or -1 if the user is protected
* @since 1.1.4
* @deprecated use getStatus().getInReplyToStatusId()
* @deprecated Use {@link #getStatus()}{@link twitter4j.Status#getInReplyToStatusId() .getInReplyToStatusId()}
*/
long getStatusInReplyToStatusId();

/**
* @return in_reply_to_user_id or -1 if the user is protected
* @since 1.1.4
* @deprecated use getStatus().getInReplyToUserId()
* @deprecated Use {@link #getStatus()}{@link Status#getInReplyToUserId() .getInReplyToUserId()}
*/
int getStatusInReplyToUserId();

/**
* @return favorited or false if the user is protected
* @since 1.1.4
* @deprecated use getStatus().isFavorited()
* @deprecated Use {@link #getStatus()}{@link twitter4j.Status#isFavorited() .isFavorited()}
*/
boolean isStatusFavorited();

/**
* @return in_reply_to_screen_name or null if the user is protected
* @since 1.1.4
* @deprecated use getStatus().getInReplyToScreenName()
* @deprecated Use {@link #getStatus()}{@link twitter4j.Status#getInReplyToScreenName() .getInReplyToScreenName()}
*/
String getStatusInReplyToScreenName();

Expand Down
8 changes: 4 additions & 4 deletions twitter4j-core/src/main/java/twitter4j/api/StatusMethods.java
Expand Up @@ -72,7 +72,7 @@ public interface StatusMethods {
* @throws TwitterException when Twitter service or network is unavailable
* @since Twitter4J 2.0.10
* @see <a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses%C2%A0update">Twitter API Wiki / Twitter REST API Method: statuses update</a>
* @deprecated use updateStatus(StatusUpdate latestStatus) instead.
* @deprecated use {@link #updateStatus(StatusUpdate)} instead.
*/
Status updateStatus(String status, GeoLocation location) throws TwitterException;

Expand All @@ -87,7 +87,7 @@ public interface StatusMethods {
* @throws TwitterException when Twitter service or network is unavailable
* @since Twitter4J 2.0.1
* @see <a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses%C2%A0update">Twitter API Wiki / Twitter REST API Method: statuses update</a>
* @deprecated use updateStatus(StatusUpdate latestStatus) instead.
* @deprecated use {@link #updateStatus(StatusUpdate)} instead.
*/
Status updateStatus(String status, long inReplyToStatusId)
throws TwitterException;
Expand All @@ -104,7 +104,7 @@ Status updateStatus(String status, long inReplyToStatusId)
* @throws TwitterException when Twitter service or network is unavailable
* @since Twitter4J 2.0.10
* @see <a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses%C2%A0update">Twitter API Wiki / Twitter REST API Method: statuses update</a>
* @deprecated use updateStatus(StatusUpdate latestStatus) instead.
* @deprecated use {@link #updateStatus(StatusUpdate)} instead.
*/
Status updateStatus(String status, long inReplyToStatusId, GeoLocation location)
throws TwitterException;
Expand All @@ -115,7 +115,7 @@ Status updateStatus(String status, long inReplyToStatusId, GeoLocation location)
* <br>This method calls http://api.twitter.com/1/statuses/update
* @param latestStatus the latest status to be updated.
* @return the latest status
* @throws TwitterException
* @throws TwitterException when Twitter service or network is unavailable
* @since Twitter4J 2.1.1
*/
Status updateStatus(StatusUpdate latestStatus) throws TwitterException;
Expand Down
Expand Up @@ -64,7 +64,7 @@ public interface StatusMethodsAsync {
* @param location The location that this tweet refers to.
* @since Twitter4J 2.1.0
* @see <a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses%C2%A0update">Twitter API Wiki / Twitter REST API Method: statuses update</a>
* @deprecated use updateStatus(StatusUpdate latestStatus) instead.
* @deprecated use {@link #updateStatus(StatusUpdate)} instead.
*/
void updateStatus(String status, GeoLocation location);

Expand All @@ -77,7 +77,7 @@ public interface StatusMethodsAsync {
* @param inReplyToStatusId The ID of an existing status that the status to be posted is in reply to. This implicitly sets the in_reply_to_user_id attribute of the resulting status to the user ID of the message being replied to. Invalid/missing status IDs will be ignored.
* @see <a href="http://apiwiki.twitter.com/Twitter-REST-API-Method:-statuses%C2%A0update">Twitter API Wiki / Twitter REST API Method: statuses%C2%A0update</a>
* @since Twitter4J 2.0.1
* @deprecated use updateStatus(StatusUpdate latestStatus) instead.
* @deprecated use {@link #updateStatus(StatusUpdate)} instead.
*/
void updateStatus(String status, long inReplyToStatusId);

Expand All @@ -91,7 +91,7 @@ public interface StatusMethodsAsync {
* @param location The location that this tweet refers to.
* @since Twitter4J 2.1.0
* @see <a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses%C2%A0update">Twitter API Wiki / Twitter REST API Method: statuses update</a>
* @deprecated use updateStatus(StatusUpdate latestStatus) instead.
* @deprecated use {@link #updateStatus(StatusUpdate)} instead.
*/
void updateStatus(String status, long inReplyToStatusId, GeoLocation location);

Expand Down
10 changes: 8 additions & 2 deletions twitter4j-core/src/main/java/twitter4j/http/RequestToken.java
Expand Up @@ -60,26 +60,32 @@ public RequestToken(String token, String tokenSecret) {
/**
* @return access token
* @throws TwitterException when Twitter service or network is unavailable
* @deprecated Use Twitter.getAccessToken()
* @deprecated Use {@link twitter4j.Twitter#getOAuthAccessToken()} instead
*/
public AccessToken getAccessToken() throws TwitterException {
return oauth.getOAuthAccessToken();
}

/**
* @param oauth_verifier oauth verifier
* @return access token
* @throws TwitterException when Twitter service or network is unavailable
* @deprecated Use Twitter.getAccessToken()
* @deprecated Use {@link twitter4j.Twitter#getOAuthAccessToken()} instead
*/
public AccessToken getAccessToken(String oauth_verifier) throws TwitterException {
return oauth.getOAuthAccessToken(oauth_verifier);
}

/**
* @return authorization URL
* since Twitter4J 2.0.0
*/
public String getAuthorizationURL() {
return conf.getOAuthAuthorizationURL() + "?oauth_token=" + getToken();
}

/**
* @return authentication URL
* since Twitter4J 2.0.10
*/
public String getAuthenticationURL() {
Expand Down
Expand Up @@ -88,9 +88,6 @@ public final int getStatusCode() {
* @throws TwitterException
* @see #disconnect()
*/
/**
* {@inheritDoc}
*/
public final InputStream asStream() {
if(streamConsumed){
throw new IllegalStateException("Stream has already been consumed.");
Expand Down

0 comments on commit c4e93bc

Please sign in to comment.