@Test public void testRuntimeParams() throws ConfigurationException, IOException { Configurator conf = new Configurator(new Configuration()); Integer i1 = conf.get(Integer.class, "foo"); assertEquals(i1, 42); Integer i2 = conf.get(Integer.class, "foo"); assertEquals(i1, i2); Map<String, String> args3 = new HashMap<String, String>(); args3.put("overrideConstant", "423523524"); Integer i3 = conf.get(Integer.class, "foo", args3); assertEquals(i3, 423523524); Map<String, String> args4 = new HashMap<String, String>(); args4.put("overrideConstant", "423523236"); Integer i4 = conf.get(Integer.class, "foo", args4); assertEquals(i4, 423523236); assertEquals(new Integer(423523524), i3); assertNotSame(new Integer(423523524), i3); Integer i5 = conf.get(Integer.class, "foo", args3); assertEquals(i3, i5); assertSame(i3, i5); }
public <T> T get(Class<T> klass, String name) throws ConfigurationException { return get(klass, name, null); }
Configurator implements Cloneable { public <T> T get(Class<T> klass, String name) throws ConfigurationException { return get(klass, name, null); } }
Configurator implements Cloneable { public <T> T get(Class<T> klass, String name) throws ConfigurationException { return get(klass, name, null); } Configurator(Configuration conf); }
Configurator implements Cloneable { public <T> T get(Class<T> klass, String name) throws ConfigurationException { return get(klass, name, null); } Configurator(Configuration conf); Configuration getConf(); T get(Class<T> klass, String name); T get(Class<T> klass, String name, String runtimeKey, String runtimeValue); T get(Class<T> klass, String name, Map<String, String> runtimeParams); String resolveComponentName(Class klass, String name); Config getConfig(Class klass, String name); T construct(Class<T> klass, String name, Config conf, Map<String, String> runtimeParams); T get(Class<T> klass); void close(); }
Configurator implements Cloneable { public <T> T get(Class<T> klass, String name) throws ConfigurationException { return get(klass, name, null); } Configurator(Configuration conf); Configuration getConf(); T get(Class<T> klass, String name); T get(Class<T> klass, String name, String runtimeKey, String runtimeValue); T get(Class<T> klass, String name, Map<String, String> runtimeParams); String resolveComponentName(Class klass, String name); Config getConfig(Class klass, String name); T construct(Class<T> klass, String name, Config conf, Map<String, String> runtimeParams); T get(Class<T> klass); void close(); static final int MAX_FILE_SIZE; }