Package com.castlabs.sdk.configuration
Class CommonConfig
java.lang.Object
com.castlabs.sdk.configuration.CommonConfig
Common Configuration Utility class
- Since:
- 4.2.1
-
Method Summary
Modifier and TypeMethodDescriptionstatic PlayerConfig.BuilderbuildFromJSONConfig(String jsonConfig) Parse a Common Configuration JSON - formatted String.static JSONObjectconfigToJSON(PlayerConfig config) Creates aJSONObjectcontaining all the info from the providedPlayerConfig.
-
Method Details
-
buildFromJSONConfig
public static PlayerConfig.Builder buildFromJSONConfig(@NonNull String jsonConfig) throws JSONException Parse a Common Configuration JSON - formatted String. It returns aPlayerConfig.Builderfilled with the data available in the given json.- Parameters:
jsonConfig- the JSON String to parse- Returns:
- an instance of
PlayerConfig.Builder - Throws:
JSONException- if there's an exception while parsing
-
configToJSON
Creates aJSONObjectcontaining all the info from the providedPlayerConfig. This JSON is compatible with the common config spec.- Parameters:
config- ThePlayerConfig.- Returns:
- json object
- Throws:
JSONException- if there's an exception while creating the JSON
-