Class 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 the actual input port will be compared to the expected type set by the setExpectedType(RecordTokenType) method.

    • 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 via setExpectedType(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:
        1. Perform any validation of configuration, input types, etc
        2. Instantiate and configure sub-operators, adding them to the provided context via the method OperatorComposable.add(O)
        3. 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 class CompositeOperator
        Parameters:
        ctx - the context