facebook4j.api.FriendMethods Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of facebook4j-core Show documentation
Show all versions of facebook4j-core Show documentation
A Java library for the Facebook Graph API
/*
* Copyright 2012 Ryuji Yamashita
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package facebook4j.api;
import facebook4j.FacebookException;
import facebook4j.Friend;
import facebook4j.FriendRequest;
import facebook4j.Friendlist;
import facebook4j.Reading;
import facebook4j.ResponseList;
/**
* @author Ryuji Yamashita - roundrop at gmail.com
*/
public interface FriendMethods {
/**
* Returns the current user's friends.
* @return friends
* @throws FacebookException when Facebook service or network is unavailable
* @see User#friends - Facebook Developers
*/
ResponseList getFriends() throws FacebookException;
/**
* Returns the current user's friends.
* @param reading optional reading parameters. see Graph API#reading - Facebook Developers
* @return friends
* @throws FacebookException when Facebook service or network is unavailable
* @see User#friends - Facebook Developers
*/
ResponseList getFriends(Reading reading) throws FacebookException;
/**
* Returns a user's friends.
* @param userId the ID of a user
* @return friends
* @throws FacebookException when Facebook service or network is unavailable
* @see User#friends - Facebook Developers
*/
ResponseList getFriends(String userId) throws FacebookException;
/**
* Returns a user's friends.
* @param userId the ID of a user
* @param reading optional reading parameters. see Graph API#reading - Facebook Developers
* @return friends
* @throws FacebookException when Facebook service or network is unavailable
* @see User#friends - Facebook Developers
*/
ResponseList getFriends(String userId, Reading reading) throws FacebookException;
/**
* Returns the friend if the current user friends with.
* @param friendId the ID of the friend
* @return friend. If the current user is not a friend with the User represented by friendId, returns empty list.
* @throws FacebookException when Facebook service or network is unavailable
* @see User#friends - Facebook Developers
*/
ResponseList getBelongsFriend(String friendId) throws FacebookException;
/**
* Returns the friend if the current user friends with.
* @param friendId the ID of the friend
* @param reading optional reading parameters. see Graph API#reading - Facebook Developers
* @return friend. If the current user is not a friend with the User represented by friendId, returns empty list.
* @throws FacebookException when Facebook service or network is unavailable
* @see User#friends - Facebook Developers
*/
ResponseList getBelongsFriend(String friendId, Reading reading) throws FacebookException;
/**
* Returns the friend if a user friends with.
* @param userId the ID of a user
* @param friendId the ID of the friend
* @return friend. If the user is not a friend with the User represented by friendId, returns empty list.
* @throws FacebookException when Facebook service or network is unavailable
* @see User#friends - Facebook Developers
*/
ResponseList getBelongsFriend(String userId, String friendId) throws FacebookException;
/**
* Returns the friend if a user friends with.
* @param userId the ID of a user
* @param friendId the ID of the friend
* @param reading optional reading parameters. see Graph API#reading - Facebook Developers
* @return friend. If the user is not a friend with the User represented by friendId, returns empty list.
* @throws FacebookException when Facebook service or network is unavailable
* @see User#friends - Facebook Developers
*/
ResponseList getBelongsFriend(String userId, String friendId, Reading reading) throws FacebookException;
/**
* Returns the current user's friend lists.
* @return friend lists
* @throws FacebookException when Facebook service or network is unavailable
* @see User - Facebook Developers - Connections - friendlists
*/
ResponseList getFriendlists() throws FacebookException;
/**
* Returns the current user's friend lists.
* @param reading optional reading parameters. see Graph API#reading - Facebook Developers
* @return friend lists
* @throws FacebookException when Facebook service or network is unavailable
* @see User - Facebook Developers - Connections - friendlists
*/
ResponseList getFriendlists(Reading reading) throws FacebookException;
/**
* Returns the user's friend lists.
* @param userId the ID of a user
* @return friend lists
* @throws FacebookException when Facebook service or network is unavailable
* @see User - Facebook Developers - Connections - friendlists
*/
ResponseList getFriendlists(String userId) throws FacebookException;
/**
* Returns the user's friend lists.
* @param userId the ID of a user
* @param reading optional reading parameters. see Graph API#reading - Facebook Developers
* @return friend lists
* @throws FacebookException when Facebook service or network is unavailable
* @see User - Facebook Developers - Connections - friendlists
*/
ResponseList getFriendlists(String userId, Reading reading) throws FacebookException;
/**
* Creates the friend list for the current user.
* @param friendlistName friend list name
* @return The new friend list ID
* @throws FacebookException when Facebook service or network is unavailable
* @see User#friendlists - Facebook Developers
*/
String createFriendlist(String friendlistName) throws FacebookException;
/**
* Creates the friend list for a user.
* @param userId the ID of a user
* @param friendlistName friend list name. Maximum 25 characters
* @return The new friend list ID
* @throws FacebookException when Facebook service or network is unavailable
* @see User#friendlists - Facebook Developers
*/
String createFriendlist(String userId, String friendlistName) throws FacebookException;
/**
* Returns a single friend list.
* @param friendlistId the ID of the friend list
* @return friend list
* @throws FacebookException when Facebook service or network is unavailable
* @see FriendList - Facebook Developers
*/
Friendlist getFriendlist(String friendlistId) throws FacebookException;
/**
* Returns a single friend list.
* @param friendlistId the ID of the friend list
* @param reading optional reading parameters. see Graph API#reading - Facebook Developers
* @return friend list
* @throws FacebookException when Facebook service or network is unavailable
* @see FriendList - Facebook Developers
*/
Friendlist getFriendlist(String friendlistId, Reading reading) throws FacebookException;
/**
* Deletes the friend list.
* @param friendlistId the ID of the friend list
* @return true if delete is successful
* @throws FacebookException when Facebook service or network is unavailable
* @see FriendList - Facebook Developers
*/
boolean deleteFriendlist(String friendlistId) throws FacebookException;
/**
* Returns all of the users who are members of this list.
* @param friendlistId the ID of the friend list
* @return members of this list
* @throws FacebookException when Facebook service or network is unavailable
* @see FriendList#members - Facebook Developers
*/
ResponseList getFriendlistMembers(String friendlistId) throws FacebookException;
/**
* Adds a user to the friend list.
* @param friendlistId the ID of the friend list
* @param userId the ID of target user
* @return true if add is successful
* @throws FacebookException when Facebook service or network is unavailable
* @see FriendList#members - Facebook Developers
*/
boolean addFriendlistMember(String friendlistId, String userId) throws FacebookException;
/**
* Removes the user from a friend list.
* @param friendlistId the ID of a friend list
* @param userId the ID of a target user
* @return true if remove is successful
* @throws FacebookException when Facebook service or network is unavailable
* @see FriendList#members - Facebook Developers
*/
boolean removeFriendlistMember(String friendlistId, String userId) throws FacebookException;
/**
* Returns the current user's incoming friend requests.
* @return friend requests
* @throws FacebookException when Facebook service or network is unavailable
* @see User#friendrequests - Facebook Developers
*/
ResponseList getFriendRequests() throws FacebookException;
/**
* Returns the current user's incoming friend requests.
* @param reading optional reading parameters. see Graph API#reading - Facebook Developers
* @return friend requests
* @throws FacebookException when Facebook service or network is unavailable
* @see User#friendrequests - Facebook Developers
*/
ResponseList getFriendRequests(Reading reading) throws FacebookException;
/**
* Returns the user's incoming friend requests.
* @param userId the ID of a user
* @return friend requests
* @throws FacebookException when Facebook service or network is unavailable
* @see User#friendrequests - Facebook Developers
*/
ResponseList getFriendRequests(String userId) throws FacebookException;
/**
* Returns the user's incoming friend requests.
* @param userId the ID of a user
* @param reading optional reading parameters. see Graph API#reading - Facebook Developers
* @return friend requests
* @throws FacebookException when Facebook service or network is unavailable
* @see User#friendrequests - Facebook Developers
*/
ResponseList getFriendRequests(String userId, Reading reading) throws FacebookException;
/**
* Returns the mutual friends between the current user and friend.
* @param friendUserId the ID of a friend
* @return mutual friends
* @throws FacebookException when Facebook service or network is unavailable
* @see User#mutualfriends - Facebook Developers
*/
ResponseList getMutualFriends(String friendUserId) throws FacebookException;
/**
* Returns the mutual friends between the current user and friend.
* @param friendUserId the ID of a friend
* @param reading optional reading parameters. see Graph API#reading - Facebook Developers
* @return mutual friends
* @throws FacebookException when Facebook service or network is unavailable
* @see User#mutualfriends - Facebook Developers
*/
ResponseList getMutualFriends(String friendUserId, Reading reading) throws FacebookException;
/**
* Returns the mutual friends between two users.
* @param userId1 the ID of a user
* @param userId2 the ID of a user
* @return mutual friends
* @throws FacebookException when Facebook service or network is unavailable
* @see User#mutualfriends - Facebook Developers
*/
ResponseList getMutualFriends(String userId1, String userId2) throws FacebookException;
/**
* Returns the mutual friends between two users.
* @param userId1 the ID of a user
* @param userId2 the ID of a user
* @param reading optional reading parameters. see Graph API#reading - Facebook Developers
* @return mutual friends
* @throws FacebookException when Facebook service or network is unavailable
* @see User#mutualfriends - Facebook Developers
*/
ResponseList getMutualFriends(String userId1, String userId2, Reading reading) throws FacebookException;
}