Class QueryRecordFunction<T>
- java.lang.Object
-
- com.apple.foundationdb.record.query.expressions.QueryRecordFunction<T>
-
- Type Parameters:
T
- the result type of the function
- All Implemented Interfaces:
PlanHashable
@API(MAINTAINED) public class QueryRecordFunction<T> extends Object implements PlanHashable
Class that provides context for asserting about a specially calculated value.
-
-
Constructor Summary
Constructors Constructor Description QueryRecordFunction(RecordFunction<T> function)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
QueryComponent
equalsValue(Object comparand)
Checks if the calculated value has a value equal to the given comparand.<M extends Message>
CompletableFuture<T>eval(FDBRecordStoreBase<M> store, EvaluationContext context, FDBStoredRecord<M> record)
RecordFunction<T>
getFunction()
QueryComponent
greaterThan(Object comparand)
Checks if the calculated value has a value greater than the given comparand.QueryComponent
greaterThanOrEquals(Object comparand)
Checks if the calculated value has a value greater than or equal to the given comparand.int
hashCode()
QueryComponent
in(String param)
Checks if the result for this function is in the list that is bound to the given param.QueryComponent
in(List<?> comparand)
Checks if the result for this function is in the given list.QueryComponent
lessThan(Object comparand)
Checks if the calculated value has a value less than the given comparand.QueryComponent
lessThanOrEquals(Object comparand)
Checks if the calculated value has a value less than or equal to the given comparand.QueryComponent
notEquals(Object comparand)
Checks if the calculated value has a value not equal to the given comparand.int
planHash()
Return a hash similar tohashCode
, but with the additional guarantee that is is stable across JVMs.String
toString()
QueryComponent
withComparison(Comparisons.Type type, Object comparand)
QueryComponent
withParameterComparison(Comparisons.Type type, String parameter)
-
-
-
Constructor Detail
-
QueryRecordFunction
public QueryRecordFunction(@Nonnull RecordFunction<T> function)
-
-
Method Detail
-
getFunction
public RecordFunction<T> getFunction()
-
equalsValue
@Nonnull public QueryComponent equalsValue(@Nonnull Object comparand)
Checks if the calculated value has a value equal to the given comparand.- Parameters:
comparand
- the object to compare with the value in the calculated value- Returns:
- a new component for doing the actual evaluation
-
notEquals
@Nonnull public QueryComponent notEquals(@Nonnull Object comparand)
Checks if the calculated value has a value not equal to the given comparand.- Parameters:
comparand
- the object to compare with the value in the calculated value- Returns:
- a new component for doing the actual evaluation
-
greaterThan
@Nonnull public QueryComponent greaterThan(@Nonnull Object comparand)
Checks if the calculated value has a value greater than the given comparand.- Parameters:
comparand
- the object to compare with the value in the calculated value- Returns:
- a new component for doing the actual evaluation
-
greaterThanOrEquals
@Nonnull public QueryComponent greaterThanOrEquals(@Nonnull Object comparand)
Checks if the calculated value has a value greater than or equal to the given comparand.- Parameters:
comparand
- the object to compare with the value in the calculated value- Returns:
- a new component for doing the actual evaluation
-
lessThan
@Nonnull public QueryComponent lessThan(@Nonnull Object comparand)
Checks if the calculated value has a value less than the given comparand.- Parameters:
comparand
- the object to compare with the value in the calculated value- Returns:
- a new component for doing the actual evaluation
-
lessThanOrEquals
@Nonnull public QueryComponent lessThanOrEquals(@Nonnull Object comparand)
Checks if the calculated value has a value less than or equal to the given comparand.- Parameters:
comparand
- the object to compare with the value in the calculated value- Returns:
- a new component for doing the actual evaluation
-
in
@Nonnull public QueryComponent in(@Nonnull List<?> comparand)
Checks if the result for this function 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 the result for this function 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
-
withComparison
@Nonnull public QueryComponent withComparison(@Nonnull Comparisons.Type type, @Nonnull Object comparand)
-
withParameterComparison
@Nonnull public QueryComponent withParameterComparison(@Nonnull Comparisons.Type type, String parameter)
-
eval
public <M extends Message> CompletableFuture<T> eval(@Nonnull FDBRecordStoreBase<M> store, @Nonnull EvaluationContext context, @Nullable FDBStoredRecord<M> record)
-
planHash
public int planHash()
Description copied from interface:PlanHashable
Return a hash similar tohashCode
, but with the additional guarantee that is is stable across JVMs.- Specified by:
planHash
in interfacePlanHashable
- Returns:
- a stable hash code
-
-