default String getName() {
        final Optional<String> name = getAsString(HasNameUtil.NAME);

        if (name.isPresent()) {
            return name.get();

        } else if (getParent()
                .filter(HasChildren.class::isInstance)
                .isPresent()) {

            final String defaultName = getParent()
                    .map(HasChildren.class::cast)
                    .map(parent -> parent.defaultNameFor(this))
                    .orElseThrow(NoSuchElementException::new);

            getData().put(HasNameUtil.NAME, defaultName);
            return defaultName;
        } else if (this instanceof Project) {
            return Project.class.getSimpleName();
        } else {
            throw new SpeedmentConfigException(
                "A name is required for node of type '" + getClass().getSimpleName() + "'."
            );
        }
    }
Gets the name of this Document. If no name is present, this method might
create a name if the parent implements the {@link HasChildren} interface.
If it does not and this document is unnamed, an
{@link SpeedmentConfigException} is called.

@return the name of this Document
@throws SpeedmentConfigException if no name is specified and the parent can't
generate one
runtime-parent/runtime-config/src/main/java/com/speedment/runtime/config/trait/HasName.java