twitter4j.api
Interface BlockMethods

All Known Subinterfaces:
Twitter
All Known Implementing Classes:
TwitterImpl

public interface BlockMethods

Author:
Joern Huxhorn - jhuxhorn at googlemail.com

Method Summary
 User createBlock(long userId)
          Blocks the user specified in the ID parameter as the authenticating user.
 User createBlock(java.lang.String screenName)
          Blocks the user specified in the ID parameter as the authenticating user.
 User destroyBlock(long userId)
          Un-blocks the user specified in the ID parameter as the authenticating user.
 User destroyBlock(java.lang.String screen_name)
          Un-blocks the user specified in the ID parameter as the authenticating user.
 boolean existsBlock(long userId)
          Returns if the authenticating user is blocking a target user.
 boolean existsBlock(java.lang.String screenName)
          Returns if the authenticating user is blocking a target user.
 ResponseList<User> getBlockingUsers()
          Returns a list of user objects that the authenticating user is blocking.
 ResponseList<User> getBlockingUsers(int page)
          Returns a list of user objects that the authenticating user is blocking.
 IDs getBlockingUsersIDs()
          Returns an array of numeric user ids the authenticating user is blocking.
 

Method Detail

createBlock

User createBlock(java.lang.String screenName)
                 throws TwitterException
Blocks the user specified in the ID parameter as the authenticating user. Returns the blocked user in the requested format when successful.
This method calls http://api.twitter.com/1/blocks/create/[id].json

Parameters:
screenName - the screen_name of the user to block
Returns:
the blocked user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
POST blocks/create | dev.twitter.com

createBlock

User createBlock(long userId)
                 throws TwitterException
Blocks the user specified in the ID parameter as the authenticating user. Returns the blocked user in the requested format when successful.
This method calls http://api.twitter.com/1/blocks/create/[id].json

Parameters:
userId - the ID of the user to block
Returns:
the blocked user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.0
See Also:
POST blocks/create | dev.twitter.com

destroyBlock

User destroyBlock(java.lang.String screen_name)
                  throws TwitterException
Un-blocks the user specified in the ID parameter as the authenticating user. Returns the un-blocked user in the requested format when successful.
This method calls http://api.twitter.com/1/blocks/destroy/[id].json

Parameters:
screen_name - the screen_name of the user to block
Returns:
the unblocked user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
POST blocks/destroy | dev.twitter.com

destroyBlock

User destroyBlock(long userId)
                  throws TwitterException
Un-blocks the user specified in the ID parameter as the authenticating user. Returns the un-blocked user in the requested format when successful.
This method calls http://api.twitter.com/1/blocks/destroy/[id].json

Parameters:
userId - the ID of the user to block
Returns:
the unblocked user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
POST blocks/destroy | dev.twitter.com

existsBlock

boolean existsBlock(java.lang.String screenName)
                    throws TwitterException
Returns if the authenticating user is blocking a target user. Will return the blocked user's object if a block exists, and error with a HTTP 404 response code otherwise.
This method calls http://api.twitter.com/1/blocks/exists/[id].json

Parameters:
screenName - The screen_name of the potentially blocked user.
Returns:
if the authenticating user is blocking a target user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.4
See Also:
GET blocks/exists | dev.twitter.com

existsBlock

boolean existsBlock(long userId)
                    throws TwitterException
Returns if the authenticating user is blocking a target user. Will return the blocked user's object if a block exists, and error with a HTTP 404 response code otherwise.
This method calls http://api.twitter.com/1/blocks/exists/[id].json

Parameters:
userId - The ID of the potentially blocked user.
Returns:
if the authenticating user is blocking a target user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.0
See Also:
GET blocks/exists | dev.twitter.com

getBlockingUsers

ResponseList<User> getBlockingUsers()
                                    throws TwitterException
Returns a list of user objects that the authenticating user is blocking.
This method calls http://api.twitter.com/1/blocks/blocking.json

Returns:
a list of user objects that the authenticating user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.4
See Also:
GET blocks/blocking | dev.twitter.com

getBlockingUsers

ResponseList<User> getBlockingUsers(int page)
                                    throws TwitterException
Returns a list of user objects that the authenticating user is blocking.
This method calls http://api.twitter.com/1/blocks/blocking.json

Parameters:
page - the number of page
Returns:
a list of user objects that the authenticating user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.4
See Also:
GET blocks/blocking | dev.twitter.com

getBlockingUsersIDs

IDs getBlockingUsersIDs()
                        throws TwitterException
Returns an array of numeric user ids the authenticating user is blocking.
This method calls http://api.twitter.com/1/blocks/blocking/ids

Returns:
Returns an array of numeric user ids the authenticating user is blocking.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.4
See Also:
GET blocks/blocking/ids | dev.twitter.com