Package dev.cel.runtime
Interface CelVariableResolver
-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface CelVariableResolverFunctional interface that exposes a method to find a CEL variable value by name.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Optional<java.lang.Object>find(java.lang.String name)Find a variable value, if present, byname.static CelVariableResolverhierarchicalVariableResolver(CelVariableResolver primary, CelVariableResolver secondary)Chain two variable resolvers together, using theprimaryas the initial variable source to consider, and thesecondaryas a backup.
-
-
-
Method Detail
-
find
java.util.Optional<java.lang.Object> find(java.lang.String name)
Find a variable value, if present, byname.Variable
Stringnames may be simple, e.g.statusor qualifiedpkg.qual.status. CEL resolves identifiers within an expressioncontainerusing protobuf namespace resolution rules.For example, given an expression container name
a.b.c.M.Nand a variable nameR.s, CEL evaluators will try resolve names in the following order:a.b.c.M.N.R.sa.b.c.M.R.sa.b.c.R.sa.b.R.sa.R.sR.s
-
hierarchicalVariableResolver
static CelVariableResolver hierarchicalVariableResolver(CelVariableResolver primary, CelVariableResolver secondary)
Chain two variable resolvers together, using theprimaryas the initial variable source to consider, and thesecondaryas a backup.When a variable appears in both resolvers, then the
primaryvariable value will shadow the value in thesecondary.
-
-