Class ProviderConfiguration
-
- All Implemented Interfaces:
public class ProviderConfiguration
Providers all extend from this class and use it to provide.
- Result of the retrieval attempt
- Either the configuration data or the Error
-
-
Field Summary
Fields Modifier and Type Field Description public boolean
providerSuccess
public JSONObject
configuration
public ConfigurationProviderError
returnError
-
Constructor Summary
Constructors Constructor Description ProviderConfiguration()
Creates a no configuration data available ProviderConfiguration object. ProviderConfiguration(JSONObject configuration)
Creates a success ProviderConfiguration object which contains the specified configuration data. ProviderConfiguration(ConfigurationProviderError returnError)
Creates a failure ProviderConfiguration object which contains the specified ConfigurationProviderError.
-
Method Summary
Modifier and Type Method Description boolean
getProviderSuccess()
Retrieves whether or not the provider was successful in getting configuration data. JSONObject
getConfiguration()
Retrieves the configuration data as a JSONObject configuration object. ConfigurationProviderError
getReturnError()
Retrieves the input-related error, if any, encountered by the provider. boolean
hasConfigurationData()
Reports whether or not this object contains valid configuration data. -
-
Constructor Detail
-
ProviderConfiguration
ProviderConfiguration()
Creates a no configuration data available ProviderConfiguration object.
-
ProviderConfiguration
ProviderConfiguration(JSONObject configuration)
Creates a success ProviderConfiguration object which contains the specified configuration data.- Parameters:
configuration
- A JSONObject configuration object containing the configuration returned by the provider.
-
ProviderConfiguration
ProviderConfiguration(ConfigurationProviderError returnError)
Creates a failure ProviderConfiguration object which contains the specified ConfigurationProviderError.- Parameters:
returnError
- A ConfigurationProviderError object describing the error that was encountered by the provider.
-
-
Method Detail
-
getProviderSuccess
boolean getProviderSuccess()
Retrieves whether or not the provider was successful in getting configuration data.
- Returns:
false when there is an input-related error, otherwise returns true. True does not indicate that configuration data is available.
-
getConfiguration
@Nullable() JSONObject getConfiguration()
Retrieves the configuration data as a JSONObject configuration object.
- Returns:
A JSONObject configuration object containing the configuration data or null is there was an error. The JSONObject configuration will be empty if the provider could not retrieve the configuration data, but did not encounter an input-related error.
-
getReturnError
@Nullable() ConfigurationProviderError getReturnError()
Retrieves the input-related error, if any, encountered by the provider.
- Returns:
A ConfigurationProviderError object representing the input-related error encountered by the provider, or null if there were no input-related errors.
-
hasConfigurationData
boolean hasConfigurationData()
Reports whether or not this object contains valid configuration data.
- Returns:
true if valid configuration data is present, otherwise false.
-
-
-
-