@Test public void testDefinesEveryType() throws IOException { ProvidenceConfig config = new ProvidenceConfig(registry); File defs = copyResourceTo("/net/morimekta/providence/config/files/all_defs.cfg", temp.getRoot()); RefConfig1 ref = config.getConfig(defs); Assert.assertThat(ref, is(equalToMessage( RefConfig1.builder() .setBoolValue(true) .setByteValue((byte) 123) .setI16Value((short) 12345) .setI32Value(1234567890) .setI64Value(12345678901234567L) .setDoubleValue(1234567.1234567) .setEnumValue(Value.SECOND) .setBinValue(Binary.fromHexString("01020304")) .setStrValue("This is a string") .setMsgValue(Database.builder() .setDriver("Driver") .build()) .build()))); }
@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);  }