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
VisitorInfoand 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 booleanmDisabledprotected SharedPreferencesmStoragePreferences
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voiddelete()Deletes all storage information saved in this shared preferencevoiddisable()Disables the storageVisitorInfogetVisitorInfo()Retrieves stored visitor info from shared preferences.voidsetVisitorInfo(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:
setVisitorInfoin 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 null.- Specified by:
getVisitorInfoin interfaceVisitorInfoStorage- Returns:
- stored visitor info or null if there was none
-
delete
public void delete()
Deletes all storage information saved in this shared preference- Specified by:
deletein interfaceBaseStorage
-
disable
public void disable()
Description copied from interface:BaseStorageDisables the storage- Specified by:
disablein interfaceBaseStorage
-
-