Class OneOfThem


  • @API(MAINTAINED)
    public class OneOfThem
    extends Object
    Class for matching any value of a repeated field. The components created by this class will evaluate to true if any of the values of the associated field evaluate to true. Unless specified otherwise, none of the components require that the record be returned only once. The child components only see one of the values when evaluating.
    • Method Detail

      • matches

        @Nonnull
        public QueryComponent matches​(@Nonnull
                                      QueryComponent child)
        If the associated field is a submessage, this allows you to match against the fields within that submessage. The child is evaluated and validated in the context of this field and not the record containing this field.
        Parameters:
        child - a component asserting about the content of the submessage in this field
        Returns:
        a new component ready for evaluation
      • equalsValue

        @Nonnull
        public QueryComponent equalsValue​(@Nonnull
                                          Object comparand)
        Checks if one of the values in this repeated field is equal to the given comparand. Evaluates to null if there are no values for the field
        Parameters:
        comparand - the object to compare with the value in the field
        Returns:
        a new component for doing the actual evaluation
      • notEquals

        @Nonnull
        public QueryComponent notEquals​(@Nonnull
                                        Object comparand)
        Checks if one of the values in this repeated field is not equal to the given comparand. Evaluates to null if there are no values for the field
        Parameters:
        comparand - the object to compare with the value in the field
        Returns:
        a new component for doing the actual evaluation
      • greaterThan

        @Nonnull
        public QueryComponent greaterThan​(@Nonnull
                                          Object comparand)
        Checks if one of the values in this repeated field is greater than the given comparand. Evaluates to null if there are no values for the field
        Parameters:
        comparand - the object to compare with the value in the field
        Returns:
        a new component for doing the actual evaluation
      • greaterThanOrEquals

        @Nonnull
        public QueryComponent greaterThanOrEquals​(@Nonnull
                                                  Object comparand)
        Checks if one of the values in this repeated field is greater than or equal to the given comparand. Evaluates to null if there are no values for the field
        Parameters:
        comparand - the object to compare with the value in the field
        Returns:
        a new component for doing the actual evaluation
      • lessThan

        @Nonnull
        public QueryComponent lessThan​(@Nonnull
                                       Object comparand)
        Checks if one of the values in this repeated field is less than the given comparand. Evaluates to null if there are no values for the field
        Parameters:
        comparand - the object to compare with the value in the field
        Returns:
        a new component for doing the actual evaluation
      • lessThanOrEquals

        @Nonnull
        public QueryComponent lessThanOrEquals​(@Nonnull
                                               Object comparand)
        Checks if one of the values in this repeated field is less than or equal to the given comparand. Evaluates to null if there are no values for the field
        Parameters:
        comparand - the object to compare with the value in the field
        Returns:
        a new component for doing the actual evaluation
      • startsWith

        @Nonnull
        public QueryComponent startsWith​(@Nonnull
                                         String comparand)
        Checks if one of the values in this repeated field starts with the given string.
        Parameters:
        comparand - the object to compare with the value in the field
        Returns:
        a new component for doing the actual evaluation
      • in

        @Nonnull
        public QueryComponent in​(@Nonnull
                                 List<?> comparand)
        Checks if one of the values in this repeated field is in the given list.
        Parameters:
        comparand - a list of elements
        Returns:
        a new component for doing the actual evaluation
      • in

        @Nonnull
        public QueryComponent in​(@Nonnull
                                 String param)
        Checks if one of the values in this repeated field is in the list that is bound to the given param.
        Parameters:
        param - a param that will be bound to a list in the execution context
        Returns:
        a new component for doing the actual evaluation
      • text

        @Nonnull
        public Text text()
        Checks if one of the values in this repeated field matches some property when performing a full-text search. It does not specify any tokenizer information, so it is assumed that any tokenizer is acceptable for parsing query string (if not already tokenized) or to parse the record's text or to match against an index. If an index is used during query execution, then it is guaranteed that the same tokenizer that was used to tokenize the index is used to tokenize the query string (if not already tokenized).
        Returns:
        an intermediate object to use to select the appropriate predicate
      • text

        @Nonnull
        public Text text​(@Nullable
                         String tokenizerName)
        Checks if one of the values in this repeated field matches some property when performing a full-text search. If tokenizerName is not null, then this will use that tokenizer to tokenize the query string (if not already tokenized) and to parse the record's text. If an index is used, then it is guaranteed that the index uses this same tokenizer. If tokenizerName is null, then this behaves the same as text().
        Parameters:
        tokenizerName - the name of the tokenizer to use to tokenize the record and (if necessary) the query string
        Returns:
        an intermediate object to use to select the appropriate predicate
      • text

        @Nonnull
        public Text text​(@Nullable
                         String tokenizerName,
                         @Nullable
                         String defaultTokenizerName)
        Checks if one of the values in this repeated field matches some property when performing a full-text search. If tokenizerName is not null, then this will use that tokenizer to tokenize the query string (if not already tokenized) and to parse the record's text. If an index is used, then it is guaranteed that the index uses this same tokenizer. If tokenizerName is null, then this behaves the same as text() except that if defaultTokenizerName is not null, then it will use that tokenizer to tokenize the document and query string (if no index is available) instead of the normal default tokenizer, DefaultTextTokenizer.
        Parameters:
        tokenizerName - the name of the tokenizer to use to tokenize the record and (if necessary) the query string
        defaultTokenizerName - the name of the tokenizer to use if tokenizerName is null and no index can be found to satisfy the query
        Returns:
        an intermediate object to use to select the appropriate predicate