Class DefaultManagedConfigToJsonConverter
-
- All Implemented Interfaces:
-
com.sap.cloud.mobile.foundation.configurationprovider.ManagedConfigToJsonConverter
public class DefaultManagedConfigToJsonConverter implements ManagedConfigToJsonConverter
Provides the default method for converting managed configuration data to Json. This data consists of the application restrictions Bundle, with possible influence from the entries in the manifest restrictions. This provides the default implementation currently used by the com.sap.cloud.mobile.foundation.configurationprovider.ManagedConfigurationProvider, however the developer is free to provide their own implementation as needed. The custom implementation is to be supplied to the com.sap.cloud.mobile.foundation.configurationprovider.ManagedConfigurationProvider constructor.
-
-
Field Summary
Fields Modifier and Type Field Description public ConfigurationProviderError
lastError
-
Constructor Summary
Constructors Constructor Description DefaultManagedConfigToJsonConverter()
-
Method Summary
Modifier and Type Method Description ConfigurationProviderError
getLastError()
Returns the last error (if any) that was encountered by ConvertManagedConfigToJson. JSONObject
convertManagedConfigToJson(@Nullable() Bundle appRestrictions, @Nullable() List<RestrictionEntry> manifestRestrictions)
Converts managed configuration data to json. -
-
Method Detail
-
getLastError
@Nullable() ConfigurationProviderError getLastError()
Returns the last error (if any) that was encountered by ConvertManagedConfigToJson.
- Returns:
The com.sap.cloud.mobile.foundation.configurationprovider.ConfigurationProviderError that represents the last error (if any) that was encountered by ConvertManagedConfigToJson.
-
convertManagedConfigToJson
@Nullable() JSONObject convertManagedConfigToJson(@Nullable() Bundle appRestrictions, @Nullable() List<RestrictionEntry> manifestRestrictions)
Converts managed configuration data to json.
- Parameters:
appRestrictions
- a Bundle representing managed configuration data that is to be converted to JSON.manifestRestrictions
- a list of the application restriction (Managed Configuration) entries that are in the application manifest.- Returns:
a JSONObject representing the configuration information contained in the appRestrictions. If an error is encountered, null is returned and the last error is set to describe the error.
-
-
-
-