public class ConfigurationParser
extends java.lang.Object
| Constructor and Description |
|---|
ConfigurationParser() |
| Modifier and Type | Method and Description |
|---|---|
java.util.Collection<java.lang.String> |
getAllKeys(java.lang.String config)
Gets all setting keys from the config json.
|
<T> T |
parseValue(java.lang.Class<T> classOfT,
java.lang.String config,
java.lang.String key)
Parses a json element identified by the
key from the given json string into a primitive type (Boolean, Double, Integer or String). |
<T> T |
parseValue(java.lang.Class<T> classOfT,
java.lang.String config,
java.lang.String key,
User user)
Parses a json element identified by the
key from the given json string into a primitive type (Boolean, Double, Integer or String). |
public <T> T parseValue(java.lang.Class<T> classOfT,
java.lang.String config,
java.lang.String key)
throws com.configcat.ParsingFailedException,
java.lang.IllegalArgumentException
key from the given json string into a primitive type (Boolean, Double, Integer or String).T - the type of the desired object.classOfT - the class of T.config - the json config.key - the key of the value.ParsingFailedException - when the parsing failed.java.lang.IllegalArgumentException - when the key or the config is empty or null, or when the <T> type is not supported.public <T> T parseValue(java.lang.Class<T> classOfT,
java.lang.String config,
java.lang.String key,
User user)
throws com.configcat.ParsingFailedException,
java.lang.IllegalArgumentException
key from the given json string into a primitive type (Boolean, Double, Integer or String).T - the type of the desired object.classOfT - the class of T.config - the json config.key - the key of the value.user - the user object to identify the caller.ParsingFailedException - when the parsing failed.java.lang.IllegalArgumentException - when the key or the config is empty or null, or when the <T> type is not supported.public java.util.Collection<java.lang.String> getAllKeys(java.lang.String config)
throws com.configcat.ParsingFailedException
config - the json config.ParsingFailedException - when the parsing failed.