Package dev.cel.runtime
Class UnknownContext
- java.lang.Object
-
- dev.cel.runtime.UnknownContext
-
@Immutable public class UnknownContext extends java.lang.ObjectAsyncContext represents the state required for an iterative evaluation session in the CEL evaluator.It manages the effective state for an evaluation pass in
CelRuntime.Program.advanceEvaluation(UnknownContext).This class is conditionally thread-safe.
- Resolved values are type-erased, but must be immutable for this class to remain thread safe.
- The class implementing the variable resolver interface must be thread-safe.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UnknownContextcreate(CelVariableResolver resolver, java.util.Collection<CelAttributePattern> attributes)Creates an unknown context from a liststatic UnknownContextcreate(GlobalResolver resolver)Creates a trivial unknown context from a GlobalResolver.CelAttributeResolvercreateAttributeResolver()Creates an attribute resolver based on registered unknown patterns and resolved attribute values.GlobalResolvervariableResolver()Accessor for the underlying variable resolver.UnknownContextwithResolvedAttributes(java.util.Map<CelAttribute,java.lang.Object> resolvedAttributes)Creates a new unknown context that is a copy of the current context with the provided additional attribute values.
-
-
-
Method Detail
-
create
public static UnknownContext create(GlobalResolver resolver)
Creates a trivial unknown context from a GlobalResolver.This is used for compatibility with
CelRuntime.Programoverloads that don't specify any attributes.
-
create
public static UnknownContext create(CelVariableResolver resolver, java.util.Collection<CelAttributePattern> attributes)
Creates an unknown context from a list
-
createAttributeResolver
public CelAttributeResolver createAttributeResolver()
Creates an attribute resolver based on registered unknown patterns and resolved attribute values.This provides attribute lookups and unknown matching functions to the interpreter.
-
variableResolver
public GlobalResolver variableResolver()
Accessor for the underlying variable resolver.
-
withResolvedAttributes
public UnknownContext withResolvedAttributes(java.util.Map<CelAttribute,java.lang.Object> resolvedAttributes)
Creates a new unknown context that is a copy of the current context with the provided additional attribute values.any unknown CelAttributePatterns are removed if they are satisfied by the newly resolved attributes.
-
-