public final class VisitorInfoPrefsStorage extends java.lang.Object implements VisitorInfoStorage
Visitor 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.
Modifier and Type | Field and Description |
---|---|
protected boolean |
mDisabled |
protected android.content.SharedPreferences |
mStoragePreferences |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Deletes all storage information saved in this shared preference
|
void |
disable()
Disables the storage
|
VisitorInfo |
getVisitorInfo()
Retrieves stored visitor info from shared preferences.
|
void |
setVisitorInfo(VisitorInfo visitorInfo)
Saves the data of provided visitor info.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
delete, disable
protected final android.content.SharedPreferences mStoragePreferences
protected boolean mDisabled
public void setVisitorInfo(VisitorInfo visitorInfo)
If storage is disabled via PrefsStorage.disable()
this will do nothing.
setVisitorInfo
in interface VisitorInfoStorage
visitorInfo
- to savejava.lang.IllegalArgumentException
- if visitor info was null@Nullable public VisitorInfo getVisitorInfo()
If storage is disabled via PrefsStorage.disable()
this will return null.
getVisitorInfo
in interface VisitorInfoStorage
public void delete()
delete
in interface BaseStorage
public void disable()
BaseStorage
disable
in interface BaseStorage