All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.mmm.marshall.snakeyaml.impl.state.SnakeYamlParentNode Maven / Gradle / Ivy

There is a newer version: 0.9.11
Show newest version
package io.github.mmm.marshall.snakeyaml.impl.state;

import io.github.mmm.marshall.spi.StructuredNodeType;

/**
 * {@link SnakeYamlNode} that contains children as either {@link SnakeYamlObjectNode} or {@link SnakeYamlArrayNode}.
 *
 * @since 1.0.0
 */
public abstract class SnakeYamlParentNode extends SnakeYamlNode {

  SnakeYamlParentNode(SnakeYamlNode parent, StructuredNodeType type, String name) {

    super(parent, type, name);
  }

  /**
   * @param childName the {@link #getName() name}. May be {@code null}.
   * @param childValue the {@link #getValue() value}. May be {@code null}.
   * @return the new child {@link SnakeYamlNode}.
   */
  public SnakeYamlNode of(String childName, Object childValue) {

    return of(childName, this, childValue);
  }

  /**
   * @return the parent state.
   */
  @Override
  public SnakeYamlNode end() {

    this.parent.addValue(this.name, getValue());
    return this.parent;
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy