package org.studiorailgun.knowledge.query;

import java.util.List;
import java.util.stream.Collectors;

import org.studiorailgun.Globals;
import org.studiorailgun.knowledge.Node;

/**
 * Get a node by a property of the node
 */
public class NodePropQuery {
    

    /**
     * Gets all nodes in the web with a given name
     * @param name The name of the node
     * @return The list of nodes in the web that have that name
     */
    public static List<Node> byName(String name){
        return Globals.web.getNodes().stream().filter(node -> node.getName().equals(name)).collect(Collectors.toList());
    }

}
