ORACoreDataContainer Class Reference

Inherits ORABaseDataContainer.

Public Member Functions

  ORACoreDataContainer (Context context)
boolean  putValue (IORAConfigSetting key, String value)
String  getValue (IORAConfigSetting key)
void  loadConfig (Map<? extends IORAConfigSetting, String > settingsMap, int newVersion)
void  loadFromConfigFile ()

Detailed Description

ORACoreDataContainer is the central class to save the configuration related core module. All config data should be set and retrieved by this class only

Constructor & Destructor Documentation

◆ ORACoreDataContainer()

ORACoreDataContainer ( Context context )

Constructor

Parameters
context context

Member Function Documentation

◆ getValue()

String getValue ( IORAConfigSetting  key )
inherited

Used to retrieve key and value from storage layer.

Throws ORAModuleIDException if getModuleID() is not implemented.

Parameters
key is the key to store.
Returns
ORAConfigSettings object. If the key already exist in store, returns its value. If key is not there in store previously, then it returns default value.

◆ loadConfig()

void loadConfig ( Map<? extends IORAConfigSetting, String >  settingsMap,
int  newVersion 
)
inherited
Parameters
settingsMap
newVersion this should be greater than 0.
Deprecated:
Replaced by loadFromConfigFile() This method loads bulk data into store and this is the one time operation While loading it will check for the version. If the newVersion is greater than existing version then only it will store the data. Default version code id 0. So to loadConfig new config need to pass the value greater than 0(Start with 1). Increase the newVersion number if you want to modify existing config or addRequest new config. This method is useful to store the default / mandatory config. This can be called in android.app.Application class. To set individual config at run time refer ORABaseDataContainer::putValue()

Throws ORAModuleIDException if getModuleID() is not implemented.

◆ loadFromConfigFile()

void loadFromConfigFile ( )
inherited

Call this method to read the configuration file from assets and store.

It will throw ORARuntimeException if oracle.json is not present in assets folder, or the oracle.json contains invalid json text.

◆ putValue()

boolean putValue ( IORAConfigSetting  key,
String  value 
)

Used to store key and value in storage layer. This method is to store individual configs. To store multiple configs at a time, refer loadFromConfigFile()

Throws ORAModuleIDException if getModuleID() is not implemented.

Parameters
key is the key to store.
value is the value to store.
Returns
true if stored successfully and false if storing failed.
 
The documentation for this class was generated from the following file:
  • ORACoreDataContainer.java