twitter4j.api
Interface FriendshipMethodsAsync

All Known Implementing Classes:
AsyncTwitter

public interface FriendshipMethodsAsync

Author:
Joern Huxhorn - jhuxhorn at googlemail.com

Method Summary
 void createFriendship(int userId)
          Allows the authenticating users to follow the user specified in the ID parameter.
Returns the befriended user in the requested format when successful.
 void createFriendship(int userId, boolean follow)
          Allows the authenticating users to follow the user specified in the ID parameter.
Returns the befriended user in the requested format when successful.
 void createFriendship(java.lang.String screenName)
          Allows the authenticating users to follow the user specified in the ID parameter.
Returns the befriended user in the requested format when successful.
 void createFriendship(java.lang.String screenName, boolean follow)
          Allows the authenticating users to follow the user specified in the ID parameter.
Returns the befriended user in the requested format when successful.
 void destroyFriendship(int userId)
          Allows the authenticating users to unfollow the user specified in the ID parameter.
Returns the unfollowed user in the requested format when successful.
 void destroyFriendship(java.lang.String screenName)
          Allows the authenticating users to unfollow the user specified in the ID parameter.
Returns the unfollowed user in the requested format when successful.
 void existsFriendship(java.lang.String userA, java.lang.String userB)
          Tests for the existence of friendship between two users.
 void getIncomingFriendships(long cursor)
          Returns an array of numeric IDs for every user who has a pending request to follow the authenticating user.
 void getOutgoingFriendships(long cursor)
          Returns an array of numeric IDs for every protected user for whom the authenticating user has a pending follow request.
 void showFriendship(int sourceId, int targetId)
          Returns detailed information about the relationship between two users.
 void showFriendship(java.lang.String sourceScreenName, java.lang.String targetScreenName)
          Returns detailed information about the relationship between two users.
 

Method Detail

createFriendship

void createFriendship(java.lang.String screenName)
Allows the authenticating users to follow the user specified in the ID parameter.
Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. If you are already friends with the user an HTTP 403 will be returned.
This method calls http://api.twitter.com/1/friendships/create

Parameters:
screenName - the screen name of the user to be befriended
Since:
Twitter4J 2.0.1
See Also:
POST friendships/create/:id | dev.twitter.com

createFriendship

void createFriendship(int userId)
Allows the authenticating users to follow the user specified in the ID parameter.
Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. If you are already friends with the user an HTTP 403 will be returned.
This method calls http://api.twitter.com/1/friendships/create

Parameters:
userId - the ID of the user to be befriended
Since:
Twitter4J 2.1.0
See Also:
POST friendships/create/:id | dev.twitter.com

createFriendship

void createFriendship(java.lang.String screenName,
                      boolean follow)
Allows the authenticating users to follow the user specified in the ID parameter.
Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. If you are already friends with the user an HTTP 403 will be returned.
This method calls http://api.twitter.com/1/friendships/create

Parameters:
screenName - the screen name of the user to be befriended
follow - Enable notifications for the target user in addition to becoming friends.
Since:
Twitter4J 2.0.1
See Also:
POST friendships/create/:id | dev.twitter.com

createFriendship

void createFriendship(int userId,
                      boolean follow)
Allows the authenticating users to follow the user specified in the ID parameter.
Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. If you are already friends with the user an HTTP 403 will be returned.
This method calls http://api.twitter.com/1/friendships/create

Parameters:
userId - the ID of the user to be befriended
follow - Enable notifications for the target user in addition to becoming friends.
Since:
Twitter4J 2.1.0
See Also:
POST friendships/create/:id | dev.twitter.com

destroyFriendship

void destroyFriendship(java.lang.String screenName)
Allows the authenticating users to unfollow the user specified in the ID parameter.
Returns the unfollowed user in the requested format when successful. Returns a string describing the failure condition when unsuccessful.
This method calls http://api.twitter.com/1/friendships/destroy

Parameters:
screenName - the screen name of the user to be befriended
Since:
Twitter4J 2.0.1
See Also:
POST friendships/destroy | dev.twitter.com

destroyFriendship

void destroyFriendship(int userId)
Allows the authenticating users to unfollow the user specified in the ID parameter.
Returns the unfollowed user in the requested format when successful. Returns a string describing the failure condition when unsuccessful.
This method calls http://api.twitter.com/1/friendships/destroy

Parameters:
userId - the screen name of the user to be befriended
Since:
Twitter4J 2.1.0
See Also:
POST friendships/destroy | dev.twitter.com

existsFriendship

void existsFriendship(java.lang.String userA,
                      java.lang.String userB)
Tests for the existence of friendship between two users. Will return true if user_a follows user_b, otherwise will return false.
This method calls http://api.twitter.com/1/friendships/exists

Parameters:
userA - The ID or screen_name of the first user to test friendship for.
userB - The ID or screen_name of the second user to test friendship for.
Since:
Twitter4J 2.0.1
See Also:
GET friendships/exists | dev.twitter.com

showFriendship

void showFriendship(java.lang.String sourceScreenName,
                    java.lang.String targetScreenName)
Returns detailed information about the relationship between two users.
This method calls http://api.twitter.com/1/friendships/show.json

Parameters:
sourceScreenName - the screen name of the source user
targetScreenName - the screen name of the target user
Since:
Twitter4J 2.1.0
See Also:
GET friendships/show | dev.twitter.com

showFriendship

void showFriendship(int sourceId,
                    int targetId)
Returns detailed information about the relationship between two users.
This method calls http://api.twitter.com/1/friendships/show.json

Parameters:
sourceId - the screen ID of the source user
targetId - the screen ID of the target user
Since:
Twitter4J 2.1.0
See Also:
GET friendships/show | dev.twitter.com

getIncomingFriendships

void getIncomingFriendships(long cursor)
Returns an array of numeric IDs for every user who has a pending request to follow the authenticating user.
This method calls http://api.twitter.com/1/friendships/incoming.json

Parameters:
cursor - Breaks the results into pages. A single page contains 5000 identifiers. Provide a value of -1 to begin paging.
Since:
Twitter4J 2.1.2
See Also:
GET friendships/incoming | dev.twitter.com

getOutgoingFriendships

void getOutgoingFriendships(long cursor)
Returns an array of numeric IDs for every protected user for whom the authenticating user has a pending follow request.
This method calls http://api.twitter.com/1/friendships/outgoing.json

Parameters:
cursor - Breaks the results into pages. A single page contains 5000 identifiers. Provide a value of -1 to begin paging.
Since:
Twitter4J 2.1.2
See Also:
GET friendships/outgoing | dev.twitter.com