com.facebook
Class SharedPreferencesTokenCachingStrategy
java.lang.Object
com.facebook.TokenCachingStrategy
com.facebook.SharedPreferencesTokenCachingStrategy
public class SharedPreferencesTokenCachingStrategy
- extends TokenCachingStrategy
Method Summary |
void |
clear()
Clears out all token information stored in this cache. |
Bundle |
load()
Returns a Bundle that contains the information stored in this cache |
void |
save(Bundle bundle)
Persists all supported data types present in the passed in Bundle, to the
cache |
Methods inherited from class com.facebook.TokenCachingStrategy |
getExpirationDate, getExpirationMilliseconds, getLastRefreshDate, getLastRefreshMilliseconds, getPermissions, getSource, getToken, hasTokenInformation, putExpirationDate, putExpirationMilliseconds, putLastRefreshDate, putLastRefreshMilliseconds, putPermissions, putSource, putToken |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SharedPreferencesTokenCachingStrategy
public SharedPreferencesTokenCachingStrategy(Context context)
- Creates a default
SharedPreferencesTokenCachingStrategy
instance that provides access to a single set of token information.
- Parameters:
context
- The Context object to use to get the SharedPreferences object.
- Throws:
NullPointerException
- if the passed in Context is null
SharedPreferencesTokenCachingStrategy
public SharedPreferencesTokenCachingStrategy(Context context,
String cacheKey)
- Creates a
SharedPreferencesTokenCachingStrategy
instance
that is distinct for the passed in cacheKey.
- Parameters:
context
- The Context object to use to get the SharedPreferences object.cacheKey
- Identifies a distinct set of token information.
- Throws:
NullPointerException
- if the passed in Context is null
load
public Bundle load()
- Returns a Bundle that contains the information stored in this cache
- Specified by:
load
in class TokenCachingStrategy
- Returns:
- A Bundle with the information contained in this cache
save
public void save(Bundle bundle)
- Persists all supported data types present in the passed in Bundle, to the
cache
- Specified by:
save
in class TokenCachingStrategy
- Parameters:
bundle
- The Bundle containing information to be cached
clear
public void clear()
- Clears out all token information stored in this cache.
- Specified by:
clear
in class TokenCachingStrategy