Class UnknownContext


  • @Immutable
    public class UnknownContext
    extends java.lang.Object
    AsyncContext 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 Detail

      • create

        public static UnknownContext create​(GlobalResolver resolver)
        Creates a trivial unknown context from a GlobalResolver.

        This is used for compatibility with CelRuntime.Program overloads that don't specify any attributes.

      • 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.