Package 

Object ConfigManager


  • 
    public class ConfigManager
    
                        

    Created by adeshmukh on 10/02/25. Project Name: OSMOS-Android-SDK File Name: ConfigManager

    • Method Detail

      • loadConfig

         final Unit loadConfig(Context context, Integer resourceId)

        Loads configuration from a raw resource file. Thread-safe method that prevents race conditions during initialization.

        Parameters:
        context -
        • Application context.

        resourceId -
        • Resource ID of the config JSON file (e.g., R.raw.osmos_config).

      • loadConfigFromString

         final Unit loadConfigFromString(String jsonString)

        Loads configuration directly from a JSON string. Thread-safe method that prevents race conditions during initialization.

        Parameters:
        jsonString -
        • JSON-formatted configuration string.

      • loadConfigFromMap

         final Unit loadConfigFromMap(Map<String, Object> configMap)

        Loads configuration from a map (commonly passed from native or testing layers). Thread-safe method that prevents race conditions during initialization.

        Parameters:
        configMap -
        • Configuration map.

      • isConfigLoaded

         final Boolean isConfigLoaded()

        Checks whether the config is loaded and available. Thread-safe method using volatile field access.

      • isDebugEnabled

         final Boolean isDebugEnabled()

        Returns the debug mode flag. Thread-safe method using volatile field access.

      • getStructuredConfig

         final Config getStructuredConfig()

        Returns the strongly typed structured configuration. Thread-safe method that throws exception if config not loaded.

      • getString

         final String getString(String key)

        Retrieves a string value from the JSON config. Thread-safe method with synchronized access to configData.

        Parameters:
        key -
        • The key to retrieve