Interface ExpressionCodeGeneratorCastRule<IN,​OUT>

  • Type Parameters:
    IN - Input internal type
    OUT - Output internal type
    All Superinterfaces:
    CastRule<IN,​OUT>, CodeGeneratorCastRule<IN,​OUT>

    @Internal
    public interface ExpressionCodeGeneratorCastRule<IN,​OUT>
    extends CodeGeneratorCastRule<IN,​OUT>
    Cast rule that is able to generate a single expression containing all the casting logic.
    • Method Detail

      • generateExpression

        String generateExpression​(CodeGeneratorCastRule.Context context,
                                  String inputTerm,
                                  LogicalType inputLogicalType,
                                  LogicalType targetLogicalType)
        Generate a Java expression performing the casting. This expression can be wrapped in another expression, or assigned to a variable or returned from a function.

        NOTE: the inputTerm is always either a primitive or a non-null object, while the expression result is either a primitive or a nullable object.