twitter4j.api
Interface FriendshipMethods

All Known Implementing Classes:
Twitter

public interface FriendshipMethods

Author:
Joern Huxhorn - jhuxhorn at googlemail.com

Method Summary
 User createFriendship(int userId)
          Befriends the user specified in the ID parameter as the authenticating user.
 User createFriendship(int userId, boolean follow)
          Befriends the user specified in the ID parameter as the authenticating user.
 User createFriendship(java.lang.String screenName)
          Befriends the user specified in the ID parameter as the authenticating user.
 User createFriendship(java.lang.String screenName, boolean follow)
          Befriends the user specified in the ID parameter as the authenticating user.
 User destroyFriendship(int userId)
          Discontinues friendship with the user specified in the ID parameter as the authenticating user.
 User destroyFriendship(java.lang.String screenName)
          Discontinues friendship with the user specified in the ID parameter as the authenticating user.
 boolean existsFriendship(java.lang.String userA, java.lang.String userB)
          Tests if a friendship exists between two users.
 Relationship showFriendship(int sourceId, int targetId)
          Gets the detailed relationship status between a source user and a target user
This method calls http://api.twitter.com/1/friendships/show.json
 Relationship showFriendship(java.lang.String sourceScreenName, java.lang.String targetScreenName)
          Gets the detailed relationship status between a source user and a target user
This method calls http://api.twitter.com/1/friendships/show.json
 

Method Detail

createFriendship

User createFriendship(java.lang.String screenName)
                      throws TwitterException
Befriends the user specified in the ID parameter as the authenticating user. Returns the befriended 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/create/[id].json

Parameters:
screenName - the screen name of the user to be befriended
Returns:
the befriended user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: friendships create

createFriendship

User createFriendship(int userId)
                      throws TwitterException
Befriends the user specified in the ID parameter as the authenticating user. Returns the befriended 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/create/[id].json

Parameters:
userId - the ID of the user to be befriended
Returns:
the befriended user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.0
See Also:
Twitter API Wiki / Twitter REST API Method: friendships create

createFriendship

User createFriendship(java.lang.String screenName,
                      boolean follow)
                      throws TwitterException
Befriends the user specified in the ID parameter as the authenticating user. Returns the befriended 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/create/[id].json

Parameters:
screenName - the screen name of the user to be befriended
follow - Enable notifications for the target user in addition to becoming friends.
Returns:
the befriended user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.2
See Also:
Twitter API Wiki / Twitter REST API Method: friendships create

createFriendship

User createFriendship(int userId,
                      boolean follow)
                      throws TwitterException
Befriends the user specified in the ID parameter as the authenticating user. Returns the befriended 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/create/[id].json

Parameters:
userId - the ID of the user to be befriended
follow - Enable notifications for the target user in addition to becoming friends.
Returns:
the befriended user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.0
See Also:
Twitter API Wiki / Twitter REST API Method: friendships create

destroyFriendship

User destroyFriendship(java.lang.String screenName)
                       throws TwitterException
Discontinues friendship with the user specified in the ID parameter as the authenticating user. Returns the un-friended 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/[id].json

Parameters:
screenName - the screen name of the user for whom to request a list of friends
Returns:
User
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: friendships destroy

destroyFriendship

User destroyFriendship(int userId)
                       throws TwitterException
Discontinues friendship with the user specified in the ID parameter as the authenticating user. Returns the un-friended 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/[id].json

Parameters:
userId - the ID of the user for whom to request a list of friends
Returns:
User
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.0
See Also:
Twitter API Wiki / Twitter REST API Method: friendships destroy

existsFriendship

boolean existsFriendship(java.lang.String userA,
                         java.lang.String userB)
                         throws TwitterException
Tests if a friendship exists between two users.
This method calls http://api.twitter.com/1/friendships/exists.json

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.
Returns:
if a friendship exists between two users.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: friendships exists

showFriendship

Relationship showFriendship(java.lang.String sourceScreenName,
                            java.lang.String targetScreenName)
                            throws TwitterException
Gets the detailed relationship status between a source user and a target user
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
Returns:
Relationship
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.0
See Also:
Twitter API Wiki / Twitter REST API Method: friendships show

showFriendship

Relationship showFriendship(int sourceId,
                            int targetId)
                            throws TwitterException
Gets the detailed relationship status between a source user and a target user
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
Returns:
Relationship
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.0
See Also:
Twitter API Wiki / Twitter REST API Method: friendships show