public class ParseConfig
extends java.lang.Object
ParseConfig is a local representation of configuration data that can be set from the
Parse dashboard.| Modifier and Type | Method and Description |
|---|---|
static ParseConfig |
get()
Fetches a new configuration object from the server.
|
java.lang.Object |
get(java.lang.String key)
Access a value.
|
java.lang.Object |
get(java.lang.String key,
java.lang.Object defaultValue)
Access a value, returning a default value if the key doesn't exist.
|
boolean |
getBoolean(java.lang.String key)
Access a
boolean value. |
boolean |
getBoolean(java.lang.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.
|
java.util.Date |
getDate(java.lang.String key)
Access a
Date value. |
java.util.Date |
getDate(java.lang.String key,
java.util.Date defaultValue)
Access a
Date value, returning a default value if it doesn't exist. |
double |
getDouble(java.lang.String key)
Access a
double value. |
double |
getDouble(java.lang.String key,
double defaultValue)
Access a
double value, returning a default value if it doesn't exist. |
static <any> |
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(java.lang.String key)
Access an
int value. |
int |
getInt(java.lang.String key,
int defaultValue)
Access an
int value, returning a default value if it doesn't exist. |
org.json.JSONArray |
getJSONArray(java.lang.String key)
Access a
JSONArray value. |
org.json.JSONArray |
getJSONArray(java.lang.String key,
org.json.JSONArray defaultValue)
Access a
JSONArray value, returning a default value if it doesn't exist. |
org.json.JSONObject |
getJSONObject(java.lang.String key)
Access a
JSONObject value. |
org.json.JSONObject |
getJSONObject(java.lang.String key,
org.json.JSONObject defaultValue)
Access a
JSONObject value, returning a default value if it doesn't exist. |
<T> java.util.List<T> |
getList(java.lang.String key)
Access a
List value. |
<T> java.util.List<T> |
getList(java.lang.String key,
java.util.List<T> defaultValue)
Access a
List value, returning a default value if it doesn't exist. |
long |
getLong(java.lang.String key)
Access a
long value. |
long |
getLong(java.lang.String key,
long defaultValue)
Access a
long value, returning a default value if it doesn't exist. |
<V> java.util.Map<java.lang.String,V> |
getMap(java.lang.String key)
Access a
Map value. |
<V> java.util.Map<java.lang.String,V> |
getMap(java.lang.String key,
java.util.Map<java.lang.String,V> defaultValue)
Access a
Map value, returning a default value if it doesn't exist. |
java.lang.Number |
getNumber(java.lang.String key)
Access a numerical value.
|
java.lang.Number |
getNumber(java.lang.String key,
java.lang.Number defaultValue)
Access a numerical value, returning a default value if it doesn't exist.
|
ParseFile |
getParseFile(java.lang.String key)
Access a
ParseFile value. |
ParseFile |
getParseFile(java.lang.String key,
ParseFile defaultValue)
Access a
ParseFile value, returning a default value if it doesn't exist. |
ParseGeoPoint |
getParseGeoPoint(java.lang.String key)
Access a
ParseGeoPoint value. |
ParseGeoPoint |
getParseGeoPoint(java.lang.String key,
ParseGeoPoint defaultValue)
Access a
ParseGeoPoint value, returning a default value if it doesn't exist. |
java.lang.String |
getString(java.lang.String key)
Access a
String value. |
java.lang.String |
getString(java.lang.String key,
java.lang.String defaultValue)
Access a
String value, returning a default value if it doesn't exist. |
java.lang.String |
toString() |
public static ParseConfig getCurrentConfig()
ParseConfig if it exists, else an empty
ParseConfigpublic static ParseConfig get() throws ParseException
ParseConfig that was fetched.ParseException - Throws an exception if the server is inaccessible.public static void getInBackground(ConfigCallback callback)
get(), unless your code is already running from a background thread.callback - callback.done(config, e) is called when the fetch completes.public static <any> getInBackground()
get(), unless your code is already running from a background thread.public java.lang.Object get(java.lang.String key)
getString(java.lang.String) or getInt(java.lang.String).key - The key to access the value for.null if there is no such key.public java.lang.Object get(java.lang.String key,
java.lang.Object defaultValue)
getString(java.lang.String) or getInt(java.lang.String).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(java.lang.String key)
boolean value.key - The key to access the value for.boolean.public boolean getBoolean(java.lang.String key,
boolean defaultValue)
boolean value, returning a default value if it doesn't exist.key - The key to access the value for.defaultValue - The value to return if the key is not present or has the wrong type.boolean.public java.util.Date getDate(java.lang.String key)
Date value.key - The key to access the value for.null if there is no such key or if it is not a Date.public java.util.Date getDate(java.lang.String key,
java.util.Date defaultValue)
Date value, returning a default value if it doesn't exist.key - The key to access the value for.defaultValue - The value to return if the key is not present or has the wrong type.Date.public double getDouble(java.lang.String key)
double value.key - The key to access the value for.public double getDouble(java.lang.String key,
double defaultValue)
double value, returning a default value if it doesn't exist.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(java.lang.String key)
int value.key - The key to access the value for.public int getInt(java.lang.String key,
int defaultValue)
int value, returning a default value if it doesn't exist.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 org.json.JSONArray getJSONArray(java.lang.String key)
JSONArray value.key - The key to access the value for.null if there is no such key or if it is not a JSONArray.public org.json.JSONArray getJSONArray(java.lang.String key,
org.json.JSONArray defaultValue)
JSONArray value, returning a default value if it doesn't exist.key - The key to access the value for.defaultValue - The value to return if the key is not present or has the wrong type.JSONArray.public org.json.JSONObject getJSONObject(java.lang.String key)
JSONObject value.key - The key to access the value for.null if there is no such key or if it is not a JSONObject.public org.json.JSONObject getJSONObject(java.lang.String key,
org.json.JSONObject defaultValue)
JSONObject value, returning a default value if it doesn't exist.key - The key to access the value for.defaultValue - The value to return if the key is not present or has the wrong type.JSONObject.public <T> java.util.List<T> getList(java.lang.String key)
List value.key - The key to access the value for.null if there is no such key or if it cannot be converted to a
List.public <T> java.util.List<T> getList(java.lang.String key,
java.util.List<T> defaultValue)
List value, returning a default value if it doesn't exist.key - The key to access the value for.defaultValue - The value to return if the key is not present or has the wrong type.List.public long getLong(java.lang.String key)
long value.key - The key to access the value for.public long getLong(java.lang.String key,
long defaultValue)
long value, returning a default value if it doesn't exist.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> java.util.Map<java.lang.String,V> getMap(java.lang.String key)
Map value.key - The key to access the value for.null if there is no such key or if it cannot be converted to a
Map.public <V> java.util.Map<java.lang.String,V> getMap(java.lang.String key,
java.util.Map<java.lang.String,V> defaultValue)
Map value, returning a default value if it doesn't exist.key - The key to access the value for.defaultValue - The value to return if the key is not present or has the wrong type.Map.public java.lang.Number getNumber(java.lang.String key)
key - The key to access the value for.null if there is no such key or if it is not a Number.public java.lang.Number getNumber(java.lang.String key,
java.lang.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.Number.public ParseFile getParseFile(java.lang.String key)
ParseFile value. This function will not perform a network request. Unless the
ParseFile has been downloaded (e.g. by calling ParseFile.getData()),
ParseFile.isDataAvailable() will return false.key - The key to access the value for.null if there is no such key or if it is not a ParseFile.public ParseFile getParseFile(java.lang.String key, ParseFile defaultValue)
ParseFile value, returning a default value if it doesn't exist. This function
will not perform a network request. Unless the ParseFile has been downloaded
(e.g. by calling 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.ParseFile.public ParseGeoPoint getParseGeoPoint(java.lang.String key)
ParseGeoPoint value.key - The key to access the value fornull if there is no such key or if it is not a ParseGeoPoint.public ParseGeoPoint getParseGeoPoint(java.lang.String key, ParseGeoPoint defaultValue)
ParseGeoPoint value, returning a default value if it doesn't exist.key - The key to access the value fordefaultValue - The value to return if the key is not present or has the wrong type.ParseGeoPoint.public java.lang.String getString(java.lang.String key)
String value.key - The key to access the value for.null if there is no such key or if it is not a String.public java.lang.String getString(java.lang.String key,
java.lang.String defaultValue)
String value, returning a default value if it doesn't exist.key - The key to access the value for.defaultValue - The value to return if the key is not present or has the wrong type.String.public java.lang.String toString()
toString in class java.lang.Object