Package com.castlabs.sdk.configuration
Class CommonConfig
java.lang.Object
com.castlabs.sdk.configuration.CommonConfig
Common Configuration Utility class
- Since:
- 4.2.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PlayerConfig.Builder
buildFromJSONConfig
(String jsonConfig) Parse a Common Configuration JSON - formatted String.static JSONObject
configToJSON
(PlayerConfig config) Creates aJSONObject
containing all the info from the providedPlayerConfig
.
-
Constructor Details
-
CommonConfig
public CommonConfig()
-
-
Method Details
-
buildFromJSONConfig
public static PlayerConfig.Builder buildFromJSONConfig(@NonNull String jsonConfig) throws JSONException Parse a Common Configuration JSON - formatted String. It returns aPlayerConfig.Builder
filled 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 aJSONObject
containing all the info from the providedPlayerConfig
. This JSON is compatible with the common config spec.- Parameters:
config
- ThePlayerConfig
.- Returns:
- json object
- Throws:
JSONException
-