public class ParseConfig extends Object
| Modifier and Type | Method and Description |
|---|---|
static ParseConfig |
get()
Fetches a new configuration object from the server.
|
Object |
get(String key)
Access a value.
|
Object |
get(String key,
Object defaultValue)
Access a value, returning a default value if the key doesn't exist.
|
boolean |
getBoolean(String key)
Access a boolean value.
|
boolean |
getBoolean(String key,
boolean defaultValue)
Access a boolean value, returning a default value if it doesn't exist.
|
static ParseConfig |
getCurrentConfig()
Retrieves the most recently-fetched configuration object, either from memory or
disk if necessary.
|
Date |
getDate(String key)
Access a date value.
|
Date |
getDate(String key,
Date defaultValue)
Access a date value, returning a default value if it doesn't exist.
|
double |
getDouble(String key)
Access a double value.
|
double |
getDouble(String key,
double defaultValue)
Access a double value, returning a default value if it doesn't exist.
|
static Task<ParseConfig> |
getInBackground()
Fetches a new configuration object from the server in a background thread.
|
static void |
getInBackground(ConfigCallback callback)
Fetches a new configuration object from the server in a background thread.
|
int |
getInt(String key)
Access an int value.
|
int |
getInt(String key,
int defaultValue)
Access an int value, returning a default value if it doesn't exist.
|
JSONArray |
getJSONArray(String key)
Access a JSONArray value.
|
JSONArray |
getJSONArray(String key,
JSONArray defaultValue)
Access a JSONArray value, returning a default value if it doesn't exist.
|
JSONObject |
getJSONObject(String key)
Access a JSONObject value.
|
JSONObject |
getJSONObject(String key,
JSONObject defaultValue)
Access a JSONObject value, returning a default value if it doesn't exist.
|
<T> List<T> |
getList(String key)
Access a List
|
<T> List<T> |
getList(String key,
List<T> defaultValue)
Access a List
|
long |
getLong(String key)
Access a long value.
|
long |
getLong(String key,
long defaultValue)
Access a long value, returning a default value if it doesn't exist.
|
<V> Map<String,V> |
getMap(String key)
Access a Map
|
<V> Map<String,V> |
getMap(String key,
Map<String,V> defaultValue)
Access a Map
|
Number |
getNumber(String key)
Access a numerical value.
|
Number |
getNumber(String key,
Number defaultValue)
Access a numerical value, returning a default value if it doesn't exist.
|
ParseFile |
getParseFile(String key)
Access a ParseFile value.
|
ParseFile |
getParseFile(String key,
ParseFile defaultValue)
Access a ParseFile value, returning a default value if it doesn't exist.
|
ParseGeoPoint |
getParseGeoPoint(String key)
Access a ParseGeoPoint value.
|
ParseGeoPoint |
getParseGeoPoint(String key,
ParseGeoPoint defaultValue)
Access a ParseGeoPoint value, returning a default value if it doesn't exist.
|
String |
getString(String key)
Access a string value.
|
String |
getString(String key,
String defaultValue)
Access a string value, returning a default value if it doesn't exist.
|
String |
toString() |
public static ParseConfig getCurrentConfig()
public static ParseConfig get() throws ParseException
ParseException - Throws an exception if the server is inaccessible.public static void getInBackground(ConfigCallback callback)
callback - callback.done(config, e) is called when the fetch completes.public static Task<ParseConfig> getInBackground()
public Object get(String key)
key - The key to access the value for.public Object get(String key, Object defaultValue)
key - The key to access the value for.defaultValue - The value to return if the key is not present in the configuration object.public boolean getBoolean(String key)
key - The key to access the value for.public boolean getBoolean(String key, boolean defaultValue)
key - The key to access the value for.defaultValue - The value to return if the key is not present or has the wrong type.public Date getDate(String key)
key - The key to access the value for.public Date getDate(String key, Date defaultValue)
key - The key to access the value for.defaultValue - The value to return if the key is not present or has the wrong type.public double getDouble(String key)
key - The key to access the value for.public double getDouble(String key, double defaultValue)
key - The key to access the value for.defaultValue - The value to return if the key is not present or has the wrong type.public int getInt(String key)
key - The key to access the value for.public int getInt(String key, int defaultValue)
key - The key to access the value for.defaultValue - The value to return if the key is not present or has the wrong type.public JSONArray getJSONArray(String key)
key - The key to access the value for.public JSONArray getJSONArray(String key, JSONArray defaultValue)
key - The key to access the value for.defaultValue - The value to return if the key is not present or has the wrong type.public JSONObject getJSONObject(String key)
key - The key to access the value for.public JSONObject getJSONObject(String key, JSONObject defaultValue)
key - The key to access the value for.defaultValue - The value to return if the key is not present or has the wrong type.public <T> List<T> getList(String key)
key - The key to access the value for.public <T> List<T> getList(String key, List<T> defaultValue)
key - The key to access the value for.defaultValue - The value to return if the key is not present or has the wrong type.public long getLong(String key)
key - The key to access the value for.public long getLong(String key, long defaultValue)
key - The key to access the value for.defaultValue - The value to return if the key is not present or has the wrong type.public <V> Map<String,V> getMap(String key)
key - The key to access the value for.public <V> Map<String,V> getMap(String key, Map<String,V> defaultValue)
key - The key to access the value for.defaultValue - The value to return if the key is not present or has the wrong type.public Number getNumber(String key)
key - The key to access the value for.public Number getNumber(String key, Number defaultValue)
key - The key to access the value for.defaultValue - The value to return if the key is not present or has the wrong type.public ParseFile getParseFile(String key)
ParseFile.getData()),
ParseFile.isDataAvailable() will return false.key - The key to access the value for.public ParseFile getParseFile(String key, ParseFile defaultValue)
ParseFile.getData()), ParseFile.isDataAvailable() will return false.key - The key to access the value for.defaultValue - The value to return if the key is not present or has the wrong type.public ParseGeoPoint getParseGeoPoint(String key)
key - The key to access the value forpublic ParseGeoPoint getParseGeoPoint(String key, ParseGeoPoint defaultValue)
key - The key to access the value fordefaultValue - The value to return if the key is not present or has the wrong type.public String getString(String key)
key - The key to access the value for.public String getString(String key, String defaultValue)
key - The key to access the value for.defaultValue - The value to return if the key is not present or has the wrong type.