@Override public boolean has(String path) { return !file.getNode(path).isVirtual(); }
if (!n.isVirtual()) { try { VoxelSniper.getLogger().debug("Loaded " + anno.name() + " = " + n.getValue());
node = configurationLoader.load(); if (!node.getNode("configVersion").isVirtual()) {
node = configurationLoader.load(); if (!node.getNode("configVersion").isVirtual()) {
@Test public void testCommentsTransferred() { CommentedConfigurationNode subject = SimpleCommentedConfigurationNode.root(); CommentedConfigurationNode firstChild = subject.getNode("first"); firstChild.setValue("test value"); firstChild.setComment("Such comment. Very wow."); CommentedConfigurationNode secondChild = subject.getNode("second"); secondChild.setValue("test value's evil twin"); assertFalse(secondChild.isVirtual()); secondChild.setValue(firstChild); assertEquals("test value", secondChild.getValue()); assertEquals("Such comment. Very wow.", secondChild.getComment().orElse(null)); }
@Test public void testNestedCommentsTransferred() { CommentedConfigurationNode subject = SimpleCommentedConfigurationNode.root(); CommentedConfigurationNode firstChild = subject.getNode("first"); CommentedConfigurationNode firstChildChild = firstChild.getNode("child"); firstChildChild.setValue("test value"); firstChildChild.setComment("Such comment. Very wow."); CommentedConfigurationNode secondChild = subject.getNode("second"); secondChild.setValue("test value's evil twin"); assertFalse(secondChild.isVirtual()); secondChild.setValue(firstChild); assertEquals("test value", secondChild.getNode("child").getValue()); assertEquals("Such comment. Very wow.", secondChild.getNode("child").getComment().orElse(null)); }