Package com.castlabs.sdk.configuration
Class CommonConfig
- java.lang.Object
-
- com.castlabs.sdk.configuration.CommonConfig
-
public class CommonConfig extends Object
Common Configuration Utility class- Since:
- 4.2.1
-
-
Constructor Summary
Constructors Constructor Description CommonConfig()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PlayerConfig.BuilderbuildFromJSONConfig(String jsonConfig)Parse a Common Configuration JSON - formatted String.static JSONObjectconfigToJSON(PlayerConfig config)Creates aJSONObjectcontaining all the info from the providedPlayerConfig.
-
-
-
Method Detail
-
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
@NonNull public static JSONObject configToJSON(@NonNull PlayerConfig config) throws JSONException
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
-
-