Package com.zopim.android.sdk.store
Class VisitorInfoPrefsStorage
- java.lang.Object
-
- com.zopim.android.sdk.store.VisitorInfoPrefsStorage
-
- All Implemented Interfaces:
- BaseStorage, VisitorInfoStorage
public final class VisitorInfoPrefsStorage extends java.lang.Object implements VisitorInfoStorage
Storage for saving the visitor infoVisitor info is defined in
VisitorInfo
and used to configure informative data about the user in a chat. Use this storage to save available visitor information so that next time users don't have to provide save info again.
-
-
Field Summary
Fields Modifier and Type Field and Description protected boolean
mDisabled
protected SharedPreferences
mStoragePreferences
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
delete()
Deletes all storage information saved in this shared preferencevoid
disable()
Disables the storageVisitorInfo
getVisitorInfo()
Retrieves stored visitor info from shared preferences.void
setVisitorInfo(VisitorInfo visitorInfo)
Saves the data of provided visitor info.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.zopim.android.sdk.store.BaseStorage
delete, disable
-
-
-
-
Method Detail
-
setVisitorInfo
public void setVisitorInfo(VisitorInfo visitorInfo)
Saves the data of provided visitor info.If storage is disabled via
PrefsStorage.disable()
this will do nothing.- Specified by:
setVisitorInfo
in interfaceVisitorInfoStorage
- Parameters:
visitorInfo
- to save- Throws:
java.lang.IllegalArgumentException
- if visitor info was null
-
getVisitorInfo
public VisitorInfo getVisitorInfo()
Retrieves stored visitor info from shared preferences.If storage is disabled via
PrefsStorage.disable()
this will return a default value.- Specified by:
getVisitorInfo
in interfaceVisitorInfoStorage
- Returns:
- stored visitor info or a default value if there was none
-
delete
public void delete()
Deletes all storage information saved in this shared preference- Specified by:
delete
in interfaceBaseStorage
-
disable
public void disable()
Description copied from interface:BaseStorage
Disables the storage- Specified by:
disable
in interfaceBaseStorage
-
-