Tabnine Logo
SimpleCommentedConfigurationNode.root
Code IndexAdd Tabnine to your IDE (free)

How to use
root
method
in
ninja.leaping.configurate.commented.SimpleCommentedConfigurationNode

Best Java code snippets using ninja.leaping.configurate.commented.SimpleCommentedConfigurationNode.root (Showing top 17 results out of 315)

origin: ninja.leaping.configurate/configurate-hocon

@Override
public CommentedConfigurationNode createEmptyNode(ConfigurationOptions options) {
  options = options.setAcceptedTypes(ImmutableSet.of(Map.class, List.class, Double.class,
      Long.class, Integer.class, Boolean.class, String.class, Number.class));
  return SimpleCommentedConfigurationNode.root(options);
}
origin: ninja.leaping.configurate/configurate-json

@Override
public CommentedConfigurationNode createEmptyNode(ConfigurationOptions options) {
  options = options.setAcceptedTypes(ImmutableSet.of(Map.class, List.class, Double.class, Float.class,
      Long.class, Integer.class, Boolean.class, String.class, byte[].class));
  return SimpleCommentedConfigurationNode.root(options);
}
origin: ninja.leaping.configurate/configurate-core

public static SimpleCommentedConfigurationNode root() {
  return root(ConfigurationOptions.defaults());
}
origin: me.lucko.configurate/configurate-core

@NonNull
public static SimpleCommentedConfigurationNode root() {
  return root(ConfigurationOptions.defaults());
}
origin: SpongePowered/configurate

@NonNull
public static SimpleCommentedConfigurationNode root() {
  return root(ConfigurationOptions.defaults());
}
origin: SpongePowered/configurate

@NonNull
@Override
public CommentedConfigurationNode createEmptyNode(@NonNull ConfigurationOptions options) {
  options = options.setAcceptedTypes(ImmutableSet.of(Map.class, List.class, Double.class,
      Long.class, Integer.class, Boolean.class, String.class, Number.class));
  return SimpleCommentedConfigurationNode.root(options);
}
origin: SpongePowered/configurate

@NonNull
@Override
public CommentedConfigurationNode createEmptyNode(@NonNull ConfigurationOptions options) {
  options = options.setAcceptedTypes(ImmutableSet.of(Map.class, List.class, Double.class, Float.class,
      Long.class, Integer.class, Boolean.class, String.class, byte[].class));
  return SimpleCommentedConfigurationNode.root(options);
}
origin: EngineHub/CraftBook

    typeLength = configValue.getTypeToken().getRawType().getSimpleName().length();
  ConfigurationNode node = SimpleCommentedConfigurationNode.root();
  configValue.serializeDefault(node);
configSection.append(border).append('\n');
for(ConfigValue<?> configValue : provider.getConfigurationNodes()) {
  ConfigurationNode node = SimpleCommentedConfigurationNode.root();
  configValue.serializeDefault(node);
origin: EngineHub/CraftBook

  private void appendModuleConfigurations() {
    appendHeader("Module Configurations");

    LogListBlock log = new LogListBlock();

    List<ModuleWrapper> enabledModules = CraftBookPlugin.spongeInst().moduleController.getModules().stream()
        .filter(ModuleWrapper::isEnabled).collect(Collectors.toList());

    for (ModuleWrapper<?> moduleWrapper : enabledModules) {
      Object module = moduleWrapper.getModule().orElse(null);
      if (module == null || !(module instanceof DocumentationProvider)) {
        continue;
      }
      LogListBlock configLog = log.putChild(moduleWrapper.getName());

      for (ConfigValue config : ((DocumentationProvider) module).getConfigurationNodes()) {
        ConfigurationNode node = SimpleCommentedConfigurationNode.root();
        config.serializeDefault(node);

        configLog.put(config.getKey(), node.getString("UNKNOWN"));
      }
    }

    append(log);
    appendln();
  }
}
origin: EngineHub/CraftBook

private void appendGlobalConfiguration() {
  appendHeader("Global Configuration");
  LogListBlock log = new LogListBlock();
  LogListBlock configLog = log.putChild("Configuration");
  for (ConfigValue config : CraftBookPlugin.spongeInst().getConfig().getConfigurationNodes()) {
    ConfigurationNode node = SimpleCommentedConfigurationNode.root();
    config.serializeDefault(node);
    configLog.put(config.getKey(), node.getString("UNKNOWN"));
  }
  append(log);
  appendln();
}
origin: SpongePowered/configurate

@Test
public void testWalker() {
  CommentedConfigurationNode node = SimpleCommentedConfigurationNode.root();
  node.getNode("l1-1").setValue(1);
  node.getNode("l1-1", "l2-1").setValue(1);
  node.getNode("l1-1", "l2-2").setValue(1);
  node.getNode("l1-1", "l2-3", "l3-1").setValue(1);
  node.getNode("l1-1", "l2-3", "l3-2").setValue(1);
  node.getNode("l1-1", "l2-4").setValue(1);
  node.getNode("l1-2").setValue(1);
  node.getNode("l1-2", "l2-1").setValue(ImmutableList.of(1, 2, 3));
  List<ConfigurationNodeWalker.VisitedNode<CommentedConfigurationNode>> breadthFirst = new ArrayList<>();
  Iterators.addAll(breadthFirst, ConfigurationNodeWalker.BREADTH_FIRST.walkWithPath(node));
  List<ConfigurationNodeWalker.VisitedNode<CommentedConfigurationNode>> depthFirstPre = new ArrayList<>();
  Iterators.addAll(depthFirstPre, ConfigurationNodeWalker.DEPTH_FIRST_PRE_ORDER.walkWithPath(node));
  List<ConfigurationNodeWalker.VisitedNode<CommentedConfigurationNode>> depthFirstPost = new ArrayList<>();
  Iterators.addAll(depthFirstPost, ConfigurationNodeWalker.DEPTH_FIRST_POST_ORDER.walkWithPath(node));
  assertEquals(13, breadthFirst.size());
  assertEquals(13, depthFirstPre.size());
  assertEquals(13, depthFirstPost.size());
  List<String> breadthFirstOrder = breadthFirst.stream().map(PATH_TO_STRING).collect(Collectors.toList());
  assertEquals(EXPECTED_BREADTH_FIRST_ORDER, breadthFirstOrder);
  List<String> depthFirstPreOrder = depthFirstPre.stream().map(PATH_TO_STRING).collect(Collectors.toList());
  assertEquals(EXPECTED_DEPTH_FIRST_PRE_ORDER, depthFirstPreOrder);
  List<String> depthFirstPostOrder = depthFirstPost.stream().map(PATH_TO_STRING).collect(Collectors.toList());
  assertEquals(EXPECTED_DEPTH_FIRST_POST_ORDER, depthFirstPostOrder);
}
origin: SpongePowered/configurate

@Test
public void testCommentsApplied() throws ObjectMappingException {
  CommentedConfigurationNode node = SimpleCommentedConfigurationNode.root();
  ObjectMapper<CommentedObject>.BoundInstance mapper = ObjectMapper.forClass(CommentedObject.class).bindToNew();
  CommentedObject obj = mapper.populate(node);
  obj.color = "fuchsia";
  obj.politician = "All of them";
  mapper.serialize(node);
  assertEquals("You look nice today", node.getNode("commented-key").getComment().orElse(null));
  assertEquals("fuchsia", node.getNode("commented-key").getString());
  assertFalse(node.getNode("no-comment").getComment().isPresent());
}
origin: SpongePowered/configurate

@Test
public void testNestedObjectWithComments() throws ObjectMappingException {
  CommentedConfigurationNode node = SimpleCommentedConfigurationNode.root();
  final ObjectMapper<ParentObject>.BoundInstance mapper = ObjectMapper.forObject(new ParentObject());
  mapper.populate(node);
  assertEquals("Comment on parent", node.getNode("inner").getComment().get());
  assertTrue(node.getNode("inner").hasMapChildren());
  assertEquals("Default value", node.getNode("inner", "test").getString());
  assertEquals("Something", node.getNode("inner", "test").getComment().get());
}
origin: SpongePowered/configurate

@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));
}
origin: SpongePowered/configurate

@Test
public void testInterfaceSerialization() throws ObjectMappingException {
  CommentedConfigurationNode node = SimpleCommentedConfigurationNode.root();
origin: SpongePowered/configurate

  @Test
  public void testCommentsMerged() {
    CommentedConfigurationNode source = SimpleCommentedConfigurationNode.root();
    CommentedConfigurationNode target = SimpleCommentedConfigurationNode.root();

    source.getNode("no-value").setValue("a").setComment("yeah");
    source.getNode("existing-value-no-comment").setValue("orig").setComment("maybe");
    source.getNode("existing-value").setValue("a").setComment("yeah");
    source.getNode("no-parent", "child").setValue("x").setComment("always");
    target.getNode("existing-value-no-comment").setValue("new");
    target.getNode("existing-value").setValue("b").setComment("nope");

    target.mergeValuesFrom(source);
    assertEquals("yeah", target.getNode("no-value").getComment().orElse(null));
    assertEquals("maybe", target.getNode("existing-value-no-comment").getComment().orElse(null));
    assertEquals("new", target.getNode("existing-value-no-comment").getString());
    assertEquals("nope", target.getNode("existing-value").getComment().orElse(null));
    assertEquals("always", target.getNode("no-parent", "child").getComment().orElse(null));
  }
}
origin: SpongePowered/configurate

@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));
}
ninja.leaping.configurate.commentedSimpleCommentedConfigurationNoderoot

Popular methods of SimpleCommentedConfigurationNode

  • <init>
  • attachIfNecessary
  • getOptions
  • setComment
  • copy

Popular in Java

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • setContentView (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now