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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static PlayerConfig.Builder`
  `buildFromJSONConfig(String jsonConfig)`
  Parse a Common Configuration JSON - formatted String.
  `static JSONObject`
  `configToJSON(PlayerConfig config)`
  Creates a `JSONObject` containing all the info from the provided `PlayerConfig`.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### buildFromJSONConfig

    public static PlayerConfig.Builder buildFromJSONConfig(@NonNull String jsonConfig) throws JSONException
    Parse a Common Configuration JSON - formatted String. It returns a `PlayerConfig.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

    @NonNull public static JSONObject configToJSON(@NonNull PlayerConfig config) throws JSONException
    Creates a `JSONObject` containing all the info from the provided `PlayerConfig`. This JSON is compatible with the common config spec.
    Parameters:
      `config` - The `PlayerConfig`.
    Returns:
      json object
    Throws:
      `JSONException` - if there's an exception while creating the JSON