Package dev.cel.runtime
Class StandardTypeResolver
- java.lang.Object
-
- dev.cel.runtime.StandardTypeResolver
-
- All Implemented Interfaces:
TypeResolver
@Immutable @Internal public final class StandardTypeResolver extends java.lang.Object implements TypeResolver
TheStandardTypeResolverimplements theTypeResolverand resolves types supported by the CEL standard environment.CEL Library Internals. Do Not Use.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description @Nullable ValueadaptType(@Nullable Type type)Deprecated.@Nullable ValueadaptType(CelType type)Adapt the check-timetypeinstance to a runtimeValue.static TypeResolvergetInstance(CelOptions celOptions)Obtain a singleton instance of theStandardTypeResolverappropriate for thecelOptionsprovided.@Nullable ValueresolveObjectType(java.lang.Object obj, @Nullable Value checkedTypeValue)Resolve the CEL type of theobj, using thecheckedTypeValueas hint for type disambiguation.
-
-
-
Method Detail
-
getInstance
public static TypeResolver getInstance(CelOptions celOptions)
Obtain a singleton instance of theStandardTypeResolverappropriate for thecelOptionsprovided.
-
resolveObjectType
public @Nullable Value resolveObjectType(java.lang.Object obj, @Nullable Value checkedTypeValue)
Description copied from interface:TypeResolverResolve 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.
- Specified by:
resolveObjectTypein interfaceTypeResolver
-
adaptType
public @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.- Specified by:
adaptTypein interfaceTypeResolver
-
adaptType
@Deprecated public @Nullable Value adaptType(@Nullable Type type)
Deprecated.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.- Specified by:
adaptTypein interfaceTypeResolver
-
-