public class AssertExpression extends ExpressionOperation implements cascading.operation.ValueAssertion<ScriptOperation.Context>
Tuple values. Any Tuple that
returns true for the given expression pass the assertion. This Assertion
is based on the Janino compiler.
Specifically this filter uses the ExpressionEvaluator, thus the syntax from that class is inherited here.
An expression may use field names directly as parameters in the expression, or field positions with the syntax "$n", where n is an integer.
Given an argument tuple with the fields "a" and "b", the following expression returns true:
a + b == $0 + $1
Further, the types of the tuple elements will be coerced into the given parameterTypes. Regardless of the actual tuple element values, they will be converted to the types expected by the expression.
ScriptOperation.Context, ScriptOperation.Evaluatorblock, parameterNames, parameterTypes, returnType| Constructor and Description |
|---|
AssertExpression(cascading.tuple.Fields fieldDeclaration,
java.lang.String expression,
java.lang.String[] parameterNames,
java.lang.Class[] parameterTypes)
Constructor AssertExpression creates a new AssertExpression instance.
|
AssertExpression(java.lang.String expression,
java.lang.Class parameterType)
Constructor ExpressionFilter creates a new ExpressionFilter instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
doAssert(cascading.flow.FlowProcess flowProcess,
cascading.operation.ValueAssertionCall<ScriptOperation.Context> assertionCall) |
boolean |
supportsPlannerLevel(cascading.operation.PlannerLevel plannerLevel) |
getEvaluator, getExpression, guessParameterNamesequals, evaluate, getBlock, getExtendedClass, getParameterNames, getParameterTypes, getReturnType, hashCode, preparecleanup, flush, getFieldDeclaration, getNumArgs, getTrace, isSafe, printOperationInternal, toString, toStringInternal@ConstructorProperties(value={"expression","parameterType"})
public AssertExpression(java.lang.String expression,
java.lang.Class parameterType)
expression - of type StringparameterType - of type Class@ConstructorProperties(value={"fieldDeclaration","expression","parameterNames","parameterTypes"})
public AssertExpression(cascading.tuple.Fields fieldDeclaration,
java.lang.String expression,
java.lang.String[] parameterNames,
java.lang.Class[] parameterTypes)
fieldDeclaration - of type Fieldsexpression - of type StringparameterNames - of type String[]parameterTypes - of type Class[]public boolean supportsPlannerLevel(cascading.operation.PlannerLevel plannerLevel)
supportsPlannerLevel in interface cascading.operation.PlannedOperation<ScriptOperation.Context>public void doAssert(cascading.flow.FlowProcess flowProcess, cascading.operation.ValueAssertionCall<ScriptOperation.Context> assertionCall)
doAssert in interface cascading.operation.ValueAssertion<ScriptOperation.Context>Copyright © 2007-2021 Cascading Maintainers. All Rights Reserved.