Class QueryNode

  • All Implemented Interfaces:
    Node
    Direct Known Subclasses:
    IntersectNode, UnionNode

    public abstract class QueryNode
    extends java.lang.Object
    implements Node
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.redis.lettucemod.search.querybuilder.Node

        Node.ParenMode
    • Constructor Summary

      Constructors 
      Constructor Description
      QueryNode()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      QueryNode add​(Node... nodes)
      Add children nodes to this node.
      QueryNode add​(java.lang.String field, Value... values)
      Add a match criteria to this node
      QueryNode add​(java.lang.String field, java.lang.String... values)
      Convenience method to add a list of string values
      QueryNode add​(java.lang.String field, java.util.Collection<Value> values)
      Add a list of values from a collection
      protected abstract java.lang.String getJoinString()  
      protected boolean shouldUseParens​(Node.ParenMode mode)  
      java.lang.String toString()
      Returns the string form of this node.
      java.lang.String toString​(Node.ParenMode parenMode)
      Returns the string form of this node.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • QueryNode

        public QueryNode()
    • Method Detail

      • getJoinString

        protected abstract java.lang.String getJoinString()
      • add

        public QueryNode add​(java.lang.String field,
                             Value... values)
        Add a match criteria to this node
        Parameters:
        field - The field to check. If null or empty, then any field is checked
        values - Values to check for.
        Returns:
        The current node, for chaining.
      • add

        public QueryNode add​(java.lang.String field,
                             java.lang.String... values)
        Convenience method to add a list of string values
        Parameters:
        field - Field to check for
        values - One or more string values.
        Returns:
        The current node, for chaining.
      • add

        public QueryNode add​(java.lang.String field,
                             java.util.Collection<Value> values)
        Add a list of values from a collection
        Parameters:
        field - The field to check
        values - Collection of values to match
        Returns:
        The current node for chaining.
      • add

        public QueryNode add​(Node... nodes)
        Add children nodes to this node.
        Parameters:
        nodes - Children nodes to add
        Returns:
        The current node, for chaining.
      • shouldUseParens

        protected boolean shouldUseParens​(Node.ParenMode mode)
      • toString

        public java.lang.String toString​(Node.ParenMode parenMode)
        Description copied from interface: Node
        Returns the string form of this node.
        Specified by:
        toString in interface Node
        Parameters:
        parenMode - Whether the string should be encapsulated in parentheses (...)
        Returns:
        The string query.
      • toString

        public java.lang.String toString()
        Description copied from interface: Node
        Returns the string form of this node.
        Specified by:
        toString in interface Node
        Overrides:
        toString in class java.lang.Object
        Returns:
        The query string.