cascading.operation.assertion

## Class AssertExpression

- java.lang.Object
- - cascading.operation.BaseOperation<ScriptOperation.Context>
  - - cascading.operation.expression.ScriptOperation
    - - cascading.operation.expression.ExpressionOperation
      - - cascading.operation.assertion.AssertExpression

All Implemented Interfaces:
  DeclaresResults, Assertion<ScriptOperation.Context>, Operation<ScriptOperation.Context>, PlannedOperation<ScriptOperation.Context>, ValueAssertion<ScriptOperation.Context>, Traceable, java.io.Serializable

    public class AssertExpression
    extends ExpressionOperation
    implements ValueAssertion<ScriptOperation.Context>

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.

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.

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class cascading.operation.expression.ScriptOperation

`ScriptOperation.Context`

### Field Summary

### Fields inherited from class cascading.operation.expression.ScriptOperation

`block, parameterNames, parameterTypes, returnType`

### Fields inherited from class cascading.operation.BaseOperation

`fieldDeclaration, numArgs, trace`

### Fields inherited from interface cascading.operation.Operation

`ANY`

### Constructor Summary

Constructors
Constructor and Description
`AssertExpression(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.

### Method Summary

Methods
`void` `doAssert(FlowProcess flowProcess, ValueAssertionCall<ScriptOperation.Context> assertionCall)`
`boolean` `supportsPlannerLevel(PlannerLevel plannerLevel)`

### Methods inherited from class cascading.operation.expression.ExpressionOperation

`getEvaluator, getExpression, guessParameterNames`

### Methods inherited from class cascading.operation.expression.ScriptOperation

`equals, evaluate, getBlock, getParameterNames, getParameterTypes, getReturnType, hashCode, prepare`

### Methods inherited from class cascading.operation.BaseOperation

`cleanup, flush, getFieldDeclaration, getNumArgs, getTrace, isSafe, printOperationInternal, toString, toStringInternal`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface cascading.operation.Operation

`cleanup, flush, getFieldDeclaration, getNumArgs, isSafe, prepare`

### Constructor Detail

#### AssertExpression

    @ConstructorProperties(value={"expression","parameterType"})
    public AssertExpression(java.lang.String expression,
                                          java.lang.Class parameterType)

Constructor ExpressionFilter creates a new ExpressionFilter instance.

Parameters:
  `expression` - of type String
  `parameterType` - of type Class

#### AssertExpression

    @ConstructorProperties(value={"fieldDeclaration","expression","parameterNames","parameterTypes"})
    public AssertExpression(Fields fieldDeclaration,
                                          java.lang.String expression,
                                          java.lang.String[] parameterNames,
                                          java.lang.Class[] parameterTypes)

Constructor AssertExpression creates a new AssertExpression instance.

Parameters:
  `fieldDeclaration` - of type Fields
  `expression` - of type String
  `parameterNames` - of type String[]
  `parameterTypes` - of type Class[]

### Method Detail

#### supportsPlannerLevel

    public boolean supportsPlannerLevel(PlannerLevel plannerLevel)

Specified by:
  `supportsPlannerLevel` in interface `PlannedOperation<ScriptOperation.Context>`

#### doAssert

    public void doAssert(FlowProcess flowProcess,
                ValueAssertionCall<ScriptOperation.Context> assertionCall)

Specified by:
  `doAssert` in interface `ValueAssertion<ScriptOperation.Context>`