Package dev.cel.runtime
Interface CelFunctionBinding
-
- All Known Subinterfaces:
InternalCelFunctionBinding
@Immutable public interface CelFunctionBindingBinding consisting of an overload id, a Java-native argument signature, and an overload definition.While the CEL function has a human-readable
camelCasename, overload ids should use the following convention where all<type>names should be ASCII lower-cased. For types prefer the unparameterized simple name of time, or unqualified name of any proto-based type:- unary member function:
_ - binary member function:
_ _ - unary global function:
_ - binary global function:
_ _ - global function:
_ _ _ - binary member function:
Examples: string_startsWith_string, mathMax_list, lessThan_money_money
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <T> CelFunctionBindingfrom(java.lang.String overloadId, java.lang.Class<T> arg, CelFunctionOverload.Unary<T> impl)Create a unary function binding from theoverloadId,arg, andimpl.static <T1,T2>
CelFunctionBindingfrom(java.lang.String overloadId, java.lang.Class<T1> arg1, java.lang.Class<T2> arg2, CelFunctionOverload.Binary<T1,T2> impl)Create a binary function binding from theoverloadId,arg1,arg2, andimpl.static CelFunctionBindingfrom(java.lang.String overloadId, java.lang.Iterable<java.lang.Class<?>> argTypes, CelFunctionOverload impl)Create a function binding from theoverloadId,argTypes, andimpl.static com.google.common.collect.ImmutableSet<CelFunctionBinding>fromOverloads(java.lang.String functionName, CelFunctionBinding... overloadBindings)static com.google.common.collect.ImmutableSet<CelFunctionBinding>fromOverloads(java.lang.String functionName, java.util.Collection<CelFunctionBinding> overloadBindings)Creates a set of bindings for a function, enabling dynamic dispatch logic to select the correct overload at runtime based on argument types.com.google.common.collect.ImmutableList<java.lang.Class<?>>getArgTypes()CelFunctionOverloadgetDefinition()java.lang.StringgetOverloadId()booleanisStrict()
-
-
-
Method Detail
-
getOverloadId
java.lang.String getOverloadId()
-
getArgTypes
com.google.common.collect.ImmutableList<java.lang.Class<?>> getArgTypes()
-
getDefinition
CelFunctionOverload getDefinition()
-
isStrict
boolean isStrict()
-
from
static <T> CelFunctionBinding from(java.lang.String overloadId, java.lang.Class<T> arg, CelFunctionOverload.Unary<T> impl)
Create a unary function binding from theoverloadId,arg, andimpl.
-
from
static <T1,T2> CelFunctionBinding from(java.lang.String overloadId, java.lang.Class<T1> arg1, java.lang.Class<T2> arg2, CelFunctionOverload.Binary<T1,T2> impl)
Create a binary function binding from theoverloadId,arg1,arg2, andimpl.
-
from
static CelFunctionBinding from(java.lang.String overloadId, java.lang.Iterable<java.lang.Class<?>> argTypes, CelFunctionOverload impl)
Create a function binding from theoverloadId,argTypes, andimpl.
-
fromOverloads
static com.google.common.collect.ImmutableSet<CelFunctionBinding> fromOverloads(java.lang.String functionName, CelFunctionBinding... overloadBindings)
-
fromOverloads
static com.google.common.collect.ImmutableSet<CelFunctionBinding> fromOverloads(java.lang.String functionName, java.util.Collection<CelFunctionBinding> overloadBindings)
Creates a set of bindings for a function, enabling dynamic dispatch logic to select the correct overload at runtime based on argument types.
-
-