Class OneOfThem
- java.lang.Object
-
- com.apple.foundationdb.record.query.expressions.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.
-
-
Constructor Summary
Constructors Constructor Description OneOfThem(String fieldName)
OneOfThem(String fieldName, Field.OneOfThemEmptyMode emptyMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryComponent
equalsValue(Object comparand)
Checks if one of the values in this repeated field is equal to the given comparand.QueryComponent
greaterThan(Object comparand)
Checks if one of the values in this repeated field is greater than the given comparand.QueryComponent
greaterThanOrEquals(Object comparand)
Checks if one of the values in this repeated field is greater than or equal to the given comparand.QueryComponent
in(String param)
Checks if one of the values in this repeated field is in the list that is bound to the given param.QueryComponent
in(List<?> comparand)
Checks if one of the values in this repeated field is in the given list.QueryComponent
lessThan(Object comparand)
Checks if one of the values in this repeated field is less than the given comparand.QueryComponent
lessThanOrEquals(Object comparand)
Checks if one of the values in this repeated field is less than or equal to the given comparand.QueryComponent
matches(QueryComponent child)
If the associated field is a submessage, this allows you to match against the fields within that submessage.QueryComponent
notEquals(Object comparand)
Checks if one of the values in this repeated field is not equal to the given comparand.QueryComponent
startsWith(String comparand)
Checks if one of the values in this repeated field starts with the given string.Text
text()
Checks if one of the values in this repeated field matches some property when performing a full-text search.Text
text(String tokenizerName)
Checks if one of the values in this repeated field matches some property when performing a full-text search.Text
text(String tokenizerName, String defaultTokenizerName)
Checks if one of the values in this repeated field matches some property when performing a full-text search.
-
-
-
Constructor Detail
-
OneOfThem
public OneOfThem(@Nonnull String fieldName, Field.OneOfThemEmptyMode emptyMode)
-
-
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. IftokenizerName
is notnull
, 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. IftokenizerName
isnull
, then this behaves the same astext()
.- 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. IftokenizerName
is notnull
, 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. IftokenizerName
isnull
, then this behaves the same astext()
except that ifdefaultTokenizerName
is notnull
, 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 stringdefaultTokenizerName
- the name of the tokenizer to use iftokenizerName
isnull
and no index can be found to satisfy the query- Returns:
- an intermediate object to use to select the appropriate predicate
-
-