Package com.restfb
Class AccessToken
java.lang.Object
com.restfb.AccessToken
Represents an access token/expiration date pair.
Facebook returns these types when performing access token-related operations - see
FacebookClient.convertSessionKeysToAccessTokens(String, String, String...),
FacebookClient.obtainAppAccessToken(String, String), and
FacebookClient.obtainExtendedAccessToken(String, String, String) for details.
- Author:
- Mark Allen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic AccessTokenfromQueryString(String queryString) Given a query string of the formaccess_token=XXXoraccess_token=XXX&expires=YYY, return anAccessTokeninstance.The access token's value.The date on which the access token expires.The token type of this access token provided by FacebookinthashCode()voidsetClient(FacebookClient client) voidsetPermissions(List<String> permissions) voidtoString()
-
Constructor Details
-
AccessToken
public AccessToken()
-
-
Method Details
-
setClient
-
getClient
-
fromQueryString
Given a query string of the formaccess_token=XXXoraccess_token=XXX&expires=YYY, return anAccessTokeninstance.The
queryStringis required to contain anaccess_tokenparameter with a non-nullvalue. Theexpiresvalue is optional and should be the number of seconds since the epoch. If theexpiresvalue cannot be parsed, the returnedAccessTokenwill have anullexpiresvalue.- Parameters:
queryString- The Facebook query string out of which to parse anAccessTokeninstance.- Returns:
- An
AccessTokeninstance which corresponds to the givenqueryString. - Throws:
IllegalArgumentException- If noaccess_tokenparameter is present in the query string.- Since:
- 1.6.10
-
hashCode
-
equals
-
toString
-
getAccessToken
The access token's value.- Returns:
- The access token's value.
-
getExpires
The date on which the access token expires.- Returns:
- The date on which the access token expires.
-
getTokenType
The token type of this access token provided by Facebook- Returns:
- the access token type
-
getUserId
-
setUserId
-
getPermissions
-
setPermissions
-