Package dev.cel.runtime
Interface TypeResolver
-
- All Known Subinterfaces:
RuntimeTypeProvider
- All Known Implementing Classes:
DescriptorMessageProvider,RuntimeTypeProviderLegacyImpl,StandardTypeResolver
@Immutable @Internal public interface TypeResolver
TheTypeResolverdetermines the CEL type of Java-native values and assists with adapting check-time types to runtime values.CEL Library Internals. Do Not Use.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description @Nullable ValueadaptType(@Nullable Type type)Deprecated.useadaptType(CelType)instead.@Nullable ValueadaptType(CelType type)Adapt the check-timetypeinstance to a runtimeValue.@Nullable ValueresolveObjectType(java.lang.Object obj, @Nullable Value checkedTypeValue)Resolve the CEL type of theobj, using thecheckedTypeValueas hint for type disambiguation.
-
-
-
Method Detail
-
resolveObjectType
@Nullable Value resolveObjectType(java.lang.Object obj, @Nullable Value checkedTypeValue)
Resolve the CEL type of theobj, using thecheckedTypeValueas hint for type disambiguation.The
checkedTypeValueindicates 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 aLongvalue 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-timetypeinstance to a runtimeValue.When the checked
typedoes not have a runtime equivalent, e.g.Type#DYN, the return value will benull.
-
adaptType
@Deprecated @Nullable Value adaptType(@Nullable Type type)
Deprecated.useadaptType(CelType)instead. This only exists to maintain compatibility with legacy async evaluator.Adapt the check-timetypeinstance to a runtimeValue.When the checked
typedoes not have a runtime equivalent, e.g.Type#DYN, the return value will benull.
-
-