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 TypeMethodDescriptionboolean
static AccessToken
fromQueryString
(String queryString) Given a query string of the formaccess_token=XXX
oraccess_token=XXX&expires=YYY
, return anAccessToken
instance.The access token's value.The date on which the access token expires.The token type of this access token provided by Facebookint
hashCode()
void
setClient
(FacebookClient client) void
setPermissionsAsString
(String permissionsAsString) void
toString()
-
Constructor Details
-
AccessToken
public AccessToken()
-
-
Method Details
-
setClient
-
getClient
-
fromQueryString
Given a query string of the formaccess_token=XXX
oraccess_token=XXX&expires=YYY
, return anAccessToken
instance.The
queryString
is required to contain anaccess_token
parameter with a non-null
value. Theexpires
value is optional and should be the number of seconds since the epoch. If theexpires
value cannot be parsed, the returnedAccessToken
will have anull
expires
value.- Parameters:
queryString
- The Facebook query string out of which to parse anAccessToken
instance.- Returns:
- An
AccessToken
instance which corresponds to the givenqueryString
. - Throws:
IllegalArgumentException
- If noaccess_token
parameter 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
-
getPermissionsAsString
-
setPermissionsAsString
-