@Test void testSimpleLoading(final @TempDir Path tempDir) throws IOException { final URL url = getClass().getResource("/example.conf"); final Path saveTest = tempDir.resolve("text1.txt"); final HoconConfigurationLoader loader = HoconConfigurationLoader.builder() .setSource(() -> new BufferedReader(new InputStreamReader(url.openStream(), StandardCharsets.UTF_8))) .setSink(AtomicFiles.createAtomicWriterFactory(saveTest, StandardCharsets.UTF_8)).build(); final CommentedConfigurationNode node = loader.load(); assertEquals("unicorn", node.getNode("test", "op-level").getValue()); assertEquals("dragon", node.getNode("other", "op-level").getValue()); final CommentedConfigurationNode testNode = node.getNode("test"); assertEquals(" Test node", testNode.getComment()); assertEquals("dog park", node.getNode("other", "location").getValue()); loader.save(node); assertEquals(Resources.readLines(getClass().getResource("/roundtrip-test.conf"), StandardCharsets.UTF_8), Files .readAllLines(saveTest, StandardCharsets.UTF_8)); }
@NonNull public static Builder builder() { return new Builder(); }
HoconConfigurationLoader extends AbstractConfigurationLoader<CommentedConfigurationNode> { @NonNull public static Builder builder() { return new Builder(); } }
HoconConfigurationLoader extends AbstractConfigurationLoader<CommentedConfigurationNode> { @NonNull public static Builder builder() { return new Builder(); } private  HoconConfigurationLoader(final Builder build); }
HoconConfigurationLoader extends AbstractConfigurationLoader<CommentedConfigurationNode> { @NonNull public static Builder builder() { return new Builder(); } private  HoconConfigurationLoader(final Builder build); @NonNull static Builder builder(); @NonNull @Override CommentedConfigurationNode createNode(@NonNull ConfigurationOptions options); }
HoconConfigurationLoader extends AbstractConfigurationLoader<CommentedConfigurationNode> { @NonNull public static Builder builder() { return new Builder(); } private  HoconConfigurationLoader(final Builder build); @NonNull static Builder builder(); @NonNull @Override CommentedConfigurationNode createNode(@NonNull ConfigurationOptions options);  }