cascading.operation.assertion
Class AssertExpression
java.lang.Object
cascading.operation.BaseOperation
cascading.operation.expression.ExpressionOperation
cascading.operation.assertion.AssertExpression
- All Implemented Interfaces:
- Assertion, Operation, ValueAssertion, Serializable
public class AssertExpression
- extends ExpressionOperation
- implements ValueAssertion
Class AssertExpression dynamically resolves a given expression using argument Tuple values. Any Tuple that
returns true for the given expression pass the assertion. This Assertion
is based on the Janino compiler.
Specifially 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.
- See Also:
- Serialized Form
| Fields inherited from interface cascading.operation.Operation |
ANY |
|
Constructor Summary |
AssertExpression(String expression,
Class... parameterTypes)
Constructor ExpressionFilter creates a new ExpressionFilter instance. |
AssertExpression
public AssertExpression(String expression,
Class... parameterTypes)
- Constructor ExpressionFilter creates a new ExpressionFilter instance.
- Parameters:
expression - of type StringparameterTypes - of type Class[]
doAssert
public void doAssert(FlowProcess flowProcess,
ValueAssertionCall assertionCall)
- Description copied from interface:
ValueAssertion
- Method doAssert performs the assertion.
- Specified by:
doAssert in interface ValueAssertion
- See Also:
ValueAssertion.doAssert(cascading.flow.FlowProcess,cascading.operation.ValueAssertionCall)
Copyright © 2007-2008 Concurrent, Inc. All Rights Reserved.