@Test public void testGetConfig_withParent() throws IOException { File f_stage_db = copyResourceTo("/net/morimekta/providence/config/files/stage_db.cfg", temp.getRoot()); File f_stage_nocred = copyResourceTo("/net/morimekta/providence/config/files/stage_nocred.cfg", temp.getRoot()); ProvidenceConfig config = new ProvidenceConfig(registry, null, true); Database stage_db = config.getConfig(f_stage_db); Database stage_nocred = config.getConfig(f_stage_nocred, stage_db); assertEquals("{\n" + " uri = \"jdbc:h2:localhost:mem\"\n" + " driver = \"org.h2.Driver\"\n" + "}", debugString(stage_nocred)); }
@Nonnull public <M extends PMessage<M, F>, F extends PField> M getConfig(@Nonnull File configFile) throws ProvidenceConfigException { ConfigSupplier<M,F> supplier = resolveConfig(configFile); return supplier.get(); }
ProvidenceConfig implements ConfigResolver { @Nonnull public <M extends PMessage<M, F>, F extends PField> M getConfig(@Nonnull File configFile) throws ProvidenceConfigException { ConfigSupplier<M,F> supplier = resolveConfig(configFile); return supplier.get(); } }
ProvidenceConfig implements ConfigResolver { @Nonnull public <M extends PMessage<M, F>, F extends PField> M getConfig(@Nonnull File configFile) throws ProvidenceConfigException { ConfigSupplier<M,F> supplier = resolveConfig(configFile); return supplier.get(); } ProvidenceConfig(TypeRegistry registry);  ProvidenceConfig(@Nonnull TypeRegistry registry,
                            @Nullable FileWatcher watcher, boolean strict);  ProvidenceConfig(@Nonnull TypeRegistry registry,
                            @Nullable FileWatcher watcher,
                            boolean strict,
                            @Nonnull Clock clock); }
ProvidenceConfig implements ConfigResolver { @Nonnull public <M extends PMessage<M, F>, F extends PField> M getConfig(@Nonnull File configFile) throws ProvidenceConfigException { ConfigSupplier<M,F> supplier = resolveConfig(configFile); return supplier.get(); } ProvidenceConfig(TypeRegistry registry);  ProvidenceConfig(@Nonnull TypeRegistry registry,
                            @Nullable FileWatcher watcher, boolean strict);  ProvidenceConfig(@Nonnull TypeRegistry registry,
                            @Nullable FileWatcher watcher,
                            boolean strict,
                            @Nonnull Clock clock); @Nonnull @Override @SuppressWarnings("unchecked") ConfigSupplier<M, F> resolveConfig(@Nonnull File configFile,
                                       @Nullable ConfigSupplier<M, F> parentConfig); @Nonnull M getConfig(@Nonnull File configFile); @Nonnull M getConfig(@Nonnull File configFile, @Nonnull M parent); }
ProvidenceConfig implements ConfigResolver { @Nonnull public <M extends PMessage<M, F>, F extends PField> M getConfig(@Nonnull File configFile) throws ProvidenceConfigException { ConfigSupplier<M,F> supplier = resolveConfig(configFile); return supplier.get(); } ProvidenceConfig(TypeRegistry registry);  ProvidenceConfig(@Nonnull TypeRegistry registry,
                            @Nullable FileWatcher watcher, boolean strict);  ProvidenceConfig(@Nonnull TypeRegistry registry,
                            @Nullable FileWatcher watcher,
                            boolean strict,
                            @Nonnull Clock clock); @Nonnull @Override @SuppressWarnings("unchecked") ConfigSupplier<M, F> resolveConfig(@Nonnull File configFile,
                                       @Nullable ConfigSupplier<M, F> parentConfig); @Nonnull M getConfig(@Nonnull File configFile); @Nonnull M getConfig(@Nonnull File configFile, @Nonnull M parent);  }