Package dev.cel.runtime
Class DefaultDispatcher
- java.lang.Object
-
- dev.cel.runtime.DefaultDispatcher
-
- All Implemented Interfaces:
CelFunctionResolver
@Immutable @Internal public final class DefaultDispatcher extends java.lang.Object implements CelFunctionResolver
Default implementation of dispatcher.CEL Library Internals. Do Not Use.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultDispatcher.BuilderBuilder forDefaultDispatcher.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<CelResolvedOverload>findOverload(java.lang.String functionName)java.util.Optional<CelResolvedOverload>findOverloadMatchingArgs(java.lang.String functionName, java.lang.Object[] args)Finds a specific function overload to invoke based on given parameters, scanning all available overloads if necessary.java.util.Optional<CelResolvedOverload>findOverloadMatchingArgs(java.lang.String functionName, java.util.Collection<java.lang.String> overloadIds, java.lang.Object[] args)Finds a specific function overload to invoke based on given parameters.static DefaultDispatcher.BuildernewBuilder()
-
-
-
Method Detail
-
findOverload
public java.util.Optional<CelResolvedOverload> findOverload(java.lang.String functionName)
-
findOverloadMatchingArgs
public java.util.Optional<CelResolvedOverload> findOverloadMatchingArgs(java.lang.String functionName, java.lang.Object[] args) throws CelEvaluationException
Description copied from interface:CelFunctionResolverFinds a specific function overload to invoke based on given parameters, scanning all available overloads if necessary.- Specified by:
findOverloadMatchingArgsin interfaceCelFunctionResolver- Parameters:
functionName- the logical name of the function being invoked.args- The arguments to pass to the function.- Returns:
- an optional value of the resolved overload.
- Throws:
CelEvaluationException- if the overload resolution is ambiguous.
-
findOverloadMatchingArgs
public java.util.Optional<CelResolvedOverload> findOverloadMatchingArgs(java.lang.String functionName, java.util.Collection<java.lang.String> overloadIds, java.lang.Object[] args) throws CelEvaluationException
Description copied from interface:CelFunctionResolverFinds a specific function overload to invoke based on given parameters.- Specified by:
findOverloadMatchingArgsin interfaceCelFunctionResolver- Parameters:
functionName- the logical name of the function being invoked.overloadIds- A list of function overload ids. The dispatcher selects the unique overload from this list with matching arguments.args- The arguments to pass to the function.- Returns:
- an optional value of the resolved overload.
- Throws:
CelEvaluationException- if the overload resolution is ambiguous,
-
newBuilder
public static DefaultDispatcher.Builder newBuilder()
-
-