Class CelRuntimeLegacyImpl.Builder
- java.lang.Object
-
- dev.cel.runtime.CelRuntimeLegacyImpl.Builder
-
- All Implemented Interfaces:
CelRuntimeBuilder
- Enclosing class:
- CelRuntimeLegacyImpl
public static final class CelRuntimeLegacyImpl.Builder extends java.lang.Object implements CelRuntimeBuilder
Builder class forCelRuntimeLegacyImpl.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CelRuntimeBuilderaddFileTypes(DescriptorProtos.FileDescriptorSet fileDescriptorSet)Add all of theDescriptors.FileDescriptors in aFileDescriptorSetto the use for type-checking, and for object creation at interpretation time.CelRuntimeBuilderaddFileTypes(Descriptors.FileDescriptor... fileDescriptors)AddDescriptors.FileDescriptors to the use for type-checking, and for object creation at interpretation time.CelRuntimeBuilderaddFileTypes(java.lang.Iterable<Descriptors.FileDescriptor> fileDescriptors)AddDescriptors.FileDescriptors to the use for type-checking, and for object creation at interpretation time.CelRuntimeBuilderaddFunctionBindings(CelRuntime.CelFunctionBinding... bindings)Add one or moreCelRuntime.CelFunctionBindingobjects to the CEL runtime.CelRuntimeBuilderaddFunctionBindings(java.lang.Iterable<CelRuntime.CelFunctionBinding> bindings)Bind a collection ofCelRuntime.CelFunctionBindingobjects to the runtime.CelRuntimeBuilderaddLibraries(CelRuntimeLibrary... libraries)Adds one or more libraries for runtime.CelRuntimeBuilderaddLibraries(java.lang.Iterable<? extends CelRuntimeLibrary> libraries)Adds a collection of libraries for runtime.CelRuntimeBuilderaddMessageTypes(Descriptors.Descriptor... descriptors)Add messageDescriptors.Descriptors to the builder for type-checking and object creation at interpretation time.CelRuntimeBuilderaddMessageTypes(java.lang.Iterable<Descriptors.Descriptor> descriptors)Add messageDescriptors.Descriptors to the use for type-checking and object creation at interpretation time.CelRuntimeLegacyImplbuild()Build a newCelRuntimeLegacyImplinstance from the builder config.CelRuntimeBuildersetExtensionRegistry(ExtensionRegistry extensionRegistry)Sets a proto ExtensionRegistry to assist with unpacking Any messages containing a proto2 extension field.CelRuntimeBuildersetOptions(CelOptions options)Set theCelOptionsused to enable fixes and features for this CEL instance.CelRuntimeBuildersetStandardEnvironmentEnabled(boolean value)Enable or disable the standard CEL library functions and variables.CelRuntimeBuildersetTypeFactory(java.util.function.Function<java.lang.String,Message.Builder> typeFactory)Set a custom type factory for the runtime.CelRuntimeBuildersetValueProvider(CelValueProvider celValueProvider)Sets thecelValueProviderfor resolving values during evaluation.
-
-
-
Method Detail
-
setOptions
public CelRuntimeBuilder setOptions(CelOptions options)
Description copied from interface:CelRuntimeBuilderSet theCelOptionsused to enable fixes and features for this CEL instance.- Specified by:
setOptionsin interfaceCelRuntimeBuilder
-
addFunctionBindings
public CelRuntimeBuilder addFunctionBindings(CelRuntime.CelFunctionBinding... bindings)
Description copied from interface:CelRuntimeBuilderAdd one or moreCelRuntime.CelFunctionBindingobjects to the CEL runtime.Functions with duplicate overload ids will be replaced in favor of the new overload.
- Specified by:
addFunctionBindingsin interfaceCelRuntimeBuilder
-
addFunctionBindings
public CelRuntimeBuilder addFunctionBindings(java.lang.Iterable<CelRuntime.CelFunctionBinding> bindings)
Description copied from interface:CelRuntimeBuilderBind a collection ofCelRuntime.CelFunctionBindingobjects to the runtime.Functions with duplicate overload ids will be replaced in favor of the new overload.
- Specified by:
addFunctionBindingsin interfaceCelRuntimeBuilder
-
addMessageTypes
public CelRuntimeBuilder addMessageTypes(Descriptors.Descriptor... descriptors)
Description copied from interface:CelRuntimeBuilderAdd messageDescriptors.Descriptors to the builder for type-checking and object creation at interpretation time.Note, it is valid to combine type factory methods within the runtime. Only the options which have been configured will be used. The type creation search order is as follows:
-
Custom type factory (
CelRuntimeBuilder.setTypeFactory(java.util.function.Function<java.lang.String, com.google.protobuf.Message.Builder>)) Custom descriptor set {#addMessageTypes)- Specified by:
addMessageTypesin interfaceCelRuntimeBuilder
-
addMessageTypes
public CelRuntimeBuilder addMessageTypes(java.lang.Iterable<Descriptors.Descriptor> descriptors)
Description copied from interface:CelRuntimeBuilderAdd messageDescriptors.Descriptors to the use for type-checking and object creation at interpretation time.Note, it is valid to combine type factory methods within the runtime. Only the options which have been configured will be used. The type creation search order is as follows:
-
Custom type factory (
CelRuntimeBuilder.setTypeFactory(java.util.function.Function<java.lang.String, com.google.protobuf.Message.Builder>)) Custom descriptor set {#addMessageTypes)- Specified by:
addMessageTypesin interfaceCelRuntimeBuilder
-
addFileTypes
public CelRuntimeBuilder addFileTypes(Descriptors.FileDescriptor... fileDescriptors)
Description copied from interface:CelRuntimeBuilderAddDescriptors.FileDescriptors to the use for type-checking, and for object creation at interpretation time.Note, it is valid to combine type factory methods within the runtime. Only the options which have been configured will be used. The type creation search order is as follows:
- Specified by:
addFileTypesin interfaceCelRuntimeBuilder
-
addFileTypes
public CelRuntimeBuilder addFileTypes(java.lang.Iterable<Descriptors.FileDescriptor> fileDescriptors)
Description copied from interface:CelRuntimeBuilderAddDescriptors.FileDescriptors to the use for type-checking, and for object creation at interpretation time.Note, it is valid to combine type factory methods within the runtime. Only the options which have been configured will be used. The type creation search order is as follows:
- Specified by:
addFileTypesin interfaceCelRuntimeBuilder
-
addFileTypes
public CelRuntimeBuilder addFileTypes(DescriptorProtos.FileDescriptorSet fileDescriptorSet)
Description copied from interface:CelRuntimeBuilderAdd all of theDescriptors.FileDescriptors in aFileDescriptorSetto the use for type-checking, and for object creation at interpretation time.Note, it is valid to combine type factory methods within the runtime. Only the options which have been configured will be used. The type creation search order is as follows:
- Specified by:
addFileTypesin interfaceCelRuntimeBuilder
-
setTypeFactory
public CelRuntimeBuilder setTypeFactory(java.util.function.Function<java.lang.String,Message.Builder> typeFactory)
Description copied from interface:CelRuntimeBuilderSet a custom type factory for the runtime.Note: it is valid to combine type factory methods within the runtime. Only the options which have been configured will be used.
The type creation search order is as follows:
-
Custom type factory (
#setTypeFactory) Custom descriptor set {CelRuntimeBuilder.addMessageTypes(com.google.protobuf.Descriptors.Descriptor...))- Specified by:
setTypeFactoryin interfaceCelRuntimeBuilder
-
setValueProvider
public CelRuntimeBuilder setValueProvider(CelValueProvider celValueProvider)
Description copied from interface:CelRuntimeBuilderSets thecelValueProviderfor resolving values during evaluation. The provided value provider will be used first before falling back to the built-inProtoMessageValueProviderfor resolving protobuf messages.Note
CelOptions.enableCelValue()must be enabled or this method will be a no-op.- Specified by:
setValueProviderin interfaceCelRuntimeBuilder
-
setStandardEnvironmentEnabled
public CelRuntimeBuilder setStandardEnvironmentEnabled(boolean value)
Description copied from interface:CelRuntimeBuilderEnable or disable the standard CEL library functions and variables.- Specified by:
setStandardEnvironmentEnabledin interfaceCelRuntimeBuilder
-
addLibraries
public CelRuntimeBuilder addLibraries(CelRuntimeLibrary... libraries)
Description copied from interface:CelRuntimeBuilderAdds one or more libraries for runtime.- Specified by:
addLibrariesin interfaceCelRuntimeBuilder
-
addLibraries
public CelRuntimeBuilder addLibraries(java.lang.Iterable<? extends CelRuntimeLibrary> libraries)
Description copied from interface:CelRuntimeBuilderAdds a collection of libraries for runtime.- Specified by:
addLibrariesin interfaceCelRuntimeBuilder
-
setExtensionRegistry
public CelRuntimeBuilder setExtensionRegistry(ExtensionRegistry extensionRegistry)
Description copied from interface:CelRuntimeBuilderSets a proto ExtensionRegistry to assist with unpacking Any messages containing a proto2 extension field.- Specified by:
setExtensionRegistryin interfaceCelRuntimeBuilder
-
build
public CelRuntimeLegacyImpl build()
Build a newCelRuntimeLegacyImplinstance from the builder config.- Specified by:
buildin interfaceCelRuntimeBuilder
-
-