Interface CelMacroExpander

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    @Immutable
    public interface CelMacroExpander
    Converts the target and arguments of a function call that matches a macro.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.Optional<dev.cel.common.ast.CelExpr> expandMacro​(CelMacroExprFactory exprFactory, dev.cel.common.ast.CelExpr target, com.google.common.collect.ImmutableList<dev.cel.common.ast.CelExpr> arguments)
      Converts a call and its associated arguments into a new CEL AST.
    • Method Detail

      • expandMacro

        java.util.Optional<dev.cel.common.ast.CelExpr> expandMacro​(CelMacroExprFactory exprFactory,
                                                                   dev.cel.common.ast.CelExpr target,
                                                                   com.google.common.collect.ImmutableList<dev.cel.common.ast.CelExpr> arguments)
        Converts a call and its associated arguments into a new CEL AST.
        Parameters:
        exprFactory - Expression factory to assist with expansion of this macro.
        target - Target expression which the macro is being invoked on. Default instance of Expr is provided instead for global macros.
        arguments - Arguments of the call
        Returns:
        A newly generated CEL AST. Implementations may return Optional.Empty instead to signal that an expansion is not needed.