public class ConfigGetter<T extends com.yahoo.config.ConfigInstance> extends Object
Modifier and Type | Field and Description |
---|---|
private Class<T> |
clazz |
private ConfigSource |
source |
Constructor and Description |
---|
ConfigGetter(Class<T> clazz)
Creates a ConfigGetter for class
clazz |
ConfigGetter(ConfigSource source,
Class<T> clazz)
Creates a ConfigGetter for class
clazz with the specified
ConfigSource . |
Modifier and Type | Method and Description |
---|---|
static <T extends com.yahoo.config.ConfigInstance> |
getConfig(Class<T> c,
String configId)
Creates a ConfigGetter instance and returns an instance of the config class
c . |
static <T extends com.yahoo.config.ConfigInstance> |
getConfig(Class<T> c,
String configId,
ConfigSource source)
Creates a ConfigGetter instance and returns an instance of the config class
c . |
T |
getConfig(String configId)
Returns an instance of the config class specified in the constructor.
|
private final ConfigSource source
public ConfigGetter(Class<T> clazz)
clazz
clazz
- a config classpublic ConfigGetter(ConfigSource source, Class<T> clazz)
clazz
with the specified
ConfigSource
.source
- a ConfigSource
clazz
- a config classpublic T getConfig(String configId)
configId
- a config id to use when getting the configpublic static <T extends com.yahoo.config.ConfigInstance> T getConfig(Class<T> c, String configId)
c
.c
- a config classconfigId
- a config id to use when getting the configpublic static <T extends com.yahoo.config.ConfigInstance> T getConfig(Class<T> c, String configId, ConfigSource source)
c
.c
- a config classconfigId
- a config id to use when getting the configsource
- a ConfigSource
Copyright © 2018. All rights reserved.