public final class MachineIdPrefsStorage extends Object implements MachineIdStorage
Machine id is defined during initialization and is used to reconnect to a chat if still active.
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
|
String |
getMachineId()
Retrieves stored machine id from shared preferences.
|
void |
setMachineId(String machineId)
Saves the provided machine id in shared preferences.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
delete, disable
protected final android.content.SharedPreferences mStoragePreferences
protected boolean mDisabled
public void setMachineId(String machineId)
If storage is disabled via PrefsStorage.disable()
this will do nothing.
setMachineId
in interface MachineIdStorage
machineId
- to saveIllegalArgumentException
- if machine id was nullpublic String getMachineId()
If storage is disabled via PrefsStorage.disable()
this will return null.
getMachineId
in interface MachineIdStorage
public void delete()
delete
in interface BaseStorage
public void disable()
BaseStorage
disable
in interface BaseStorage