- java.lang.Object
-
- com.pervasive.datarush.operators.AbstractLogicalOperator
-
- com.pervasive.datarush.operators.CompositeOperator
-
- com.pervasive.datarush.operators.assertion.AssertEqualTypes
-
- All Implemented Interfaces:
LogicalOperator
public class AssertEqualTypes extends CompositeOperator
Asserts that two input flows have identical types. As types may not be fully realized until composition time the check is delayed until the composition phase of the life cycle.The
expected
input port is optional. If it is not connected, the type of theactual
input port will be compared to the expected type set by thesetExpectedType(RecordTokenType)
method.
-
-
Constructor Summary
Constructors Constructor Description AssertEqualTypes()
Default constructorAssertEqualTypes(RecordTokenType expectedType)
Construct with an expected type for the actual data input port.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
compose(CompositionContext ctx)
Compose the body of this operator.RecordPort
getActualInput()
Get the actual value input port.RecordPort
getExpectedInput()
Get the optional expected value input port.TokenType
getExpectedType()
Get the expected type value.void
setExpectedType(RecordTokenType expectedType)
Set the expected type of the actual value input port.-
Methods inherited from class com.pervasive.datarush.operators.AbstractLogicalOperator
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
-
-
-
-
Constructor Detail
-
AssertEqualTypes
public AssertEqualTypes()
Default constructor
-
AssertEqualTypes
public AssertEqualTypes(RecordTokenType expectedType)
Construct with an expected type for the actual data input port.- Parameters:
expectedType
- expected type
-
-
Method Detail
-
getExpectedType
public TokenType getExpectedType()
Get the expected type value.- Returns:
- expected type
-
setExpectedType
public void setExpectedType(RecordTokenType expectedType)
Set the expected type of the actual value input port. Set this type to compare the actual port type with when the expected input port is not used.- Parameters:
expectedType
- expected type of the actual port
-
getExpectedInput
public RecordPort getExpectedInput()
Get the optional expected value input port. If this port is not connected, the expected type should be set viasetExpectedType(RecordTokenType)
method.- Returns:
- optional input port
-
getActualInput
public RecordPort getActualInput()
Get the actual value input port.- Returns:
- input port
-
compose
protected void compose(CompositionContext ctx)
Description copied from class:CompositeOperator
Compose the body of this operator. Implementations should do the following:- Perform any validation of configuration, input types, etc
- Instantiate and configure sub-operators, adding them to the provided context via
the method
OperatorComposable.add(O)
- Create necessary connections via the method
OperatorComposable.connect(P, P)
. This includes connections from the composite's input ports to sub-operators, connections between sub-operators, and connections from sub-operators output ports to the composite's output ports
- Specified by:
compose
in classCompositeOperator
- Parameters:
ctx
- the context
-
-