Class SettingsProvider
-
- All Implemented Interfaces:
public class SettingsProviderFacilitates keeping a global reference to application SettingsParameters, including ApplicationId, deviceID, applicationVersion,backendURL, and version of the server. Generally the application developer will set the initialized SettingsParameters once and get it from any where SettingsParameters is needed. The set must be called at least once.
-
-
Method Summary
Modifier and Type Method Description static voidset(@NonNull() SettingsParameters settingsParameters)Sets the settingsParameters in the provider for future access using get If the settingsParameters is changed, SETTINGS_PROVIDER_SET state event will be sent to the the observers. static SettingsParametersget()Returns the settingsParameters that include basic application settings If set was not called at least once before the settings will be null and an IllegalStateException is thrown. static voidclear()-
-
Method Detail
-
set
static void set(@NonNull() SettingsParameters settingsParameters)
Sets the settingsParameters in the provider for future access using get If the settingsParameters is changed, SETTINGS_PROVIDER_SET state event will be sent to the the observers.
- Parameters:
settingsParameters- instance ofSettingsParametersthat has been built with applicationId, deviceId, applicationVersion, backendUrl and apiKey
-
get
@NonNull() static SettingsParameters get()
Returns the settingsParameters that include basic application settings If set was not called at least once before the settings will be null and an IllegalStateException is thrown.
- Returns:
settingsParameters instance of
SettingsParametersthat include basic application settings
-
clear
@RestrictTo(value = RestrictTo.Scope.TESTS) static void clear()
-
-
-
-