private static NodeEntry parseNode(ConfigurationNode configNode, String keyFieldName) {
        Map<Object, ? extends ConfigurationNode> children = configNode.getChildrenMap();
        if (children.isEmpty()) {
            return null;
        }

        // if children.size == 1 and the only entry doesn't have a key called "permission" - assume
        // the key refers to the name of the permission
        if (children.size() == 1) {
            Map.Entry<Object, ? extends ConfigurationNode> entry = Iterables.getFirst(children.entrySet(), null);
            if (entry != null) {
                String permission = entry.getKey().toString();
                ConfigurationNode attributes = entry.getValue();

                if (!permission.equals(keyFieldName) && !permission.isEmpty()) {
                    return new NodeEntry(permission, attributes);
                }
            }
        }

        // assume 'configNode' is the actual entry.
        ConfigurationNode appended = children.get(keyFieldName);
        if (appended == null) {
            return null;
        }

        String permission = appended.getString("");
        return new NodeEntry(permission, configNode);
    }
Saves a configuration node to the given location

@param location the location
@param name the name of the object
@param node the node
@throws IOException if an io error occurs
common/src/main/java/me/lucko/luckperms/common/storage/implementation/file/AbstractConfigurateStorage.java