Interface TypeResolver

    • Method Detail

      • resolveObjectType

        @Nullable Value resolveObjectType​(java.lang.Object obj,
                                          @Nullable Value checkedTypeValue)
        Resolve the CEL type of the obj, using the checkedTypeValue as hint for type disambiguation.

        The checkedTypeValue indicates the statically determined type of the object at check-time. Often, the check-time and runtime phases agree, but there are cases where the runtime type is ambiguous, as is the case when a Long value is supplied as this could either be an int, uint, or enum type.

        Type resolution is biased toward the runtime value type, given the dynamically typed nature of CEL.

      • adaptType

        @Nullable Value adaptType​(CelType type)
        Adapt the check-time type instance to a runtime Value.

        When the checked type does not have a runtime equivalent, e.g. Type#DYN, the return value will be null.

      • adaptType

        @Deprecated
        @Nullable Value adaptType​(@Nullable Type type)
        Deprecated.
        use adaptType(CelType) instead. This only exists to maintain compatibility with legacy async evaluator.
        Adapt the check-time type instance to a runtime Value.

        When the checked type does not have a runtime equivalent, e.g. Type#DYN, the return value will be null.