public final class ConfigUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
instantiate(Map<String,String> config,
String configKey,
String tryingToInstantiateWhat,
String whatHappensWhenInstantiationFails)
Create an instance of a class specified in the config under configKey.
|
public static <T> T instantiate(Map<String,String> config, String configKey, String tryingToInstantiateWhat, String whatHappensWhenInstantiationFails)
getInstance() method, or a public no-arg constructor, in this order.T - type of the class being instantiated.config - in which to look for FQN of the class to instantiate.configKey - under which to look.tryingToInstantiateWhat - for logging purposes, what is it that is being instantiated.whatHappensWhenInstantiationFails - for logging purposes, what will be the impact of failing to instantiate the class.Copyright © 2013-2016–2018 Graph Aware Limited. All rights reserved.