Class Environment

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessageV3
cel.dev.expr.conformance.Environment
All Implemented Interfaces:
EnvironmentOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

public final class Environment extends com.google.protobuf.GeneratedMessageV3 implements EnvironmentOrBuilder
 Representation of a CEL Environment, defining what features and extensions
 are available for conformance testing.
 
Protobuf type cel.expr.conformance.Environment
See Also:
  • Field Details

    • NAME_FIELD_NUMBER

      public static final int NAME_FIELD_NUMBER
      See Also:
    • DESCRIPTION_FIELD_NUMBER

      public static final int DESCRIPTION_FIELD_NUMBER
      See Also:
    • CONTAINER_FIELD_NUMBER

      public static final int CONTAINER_FIELD_NUMBER
      See Also:
    • IMPORTS_FIELD_NUMBER

      public static final int IMPORTS_FIELD_NUMBER
      See Also:
    • STDLIB_FIELD_NUMBER

      public static final int STDLIB_FIELD_NUMBER
      See Also:
    • EXTENSIONS_FIELD_NUMBER

      public static final int EXTENSIONS_FIELD_NUMBER
      See Also:
    • CONTEXT_VARIABLE_FIELD_NUMBER

      public static final int CONTEXT_VARIABLE_FIELD_NUMBER
      See Also:
    • DECLARATIONS_FIELD_NUMBER

      public static final int DECLARATIONS_FIELD_NUMBER
      See Also:
    • VALIDATORS_FIELD_NUMBER

      public static final int VALIDATORS_FIELD_NUMBER
      See Also:
    • FEATURES_FIELD_NUMBER

      public static final int FEATURES_FIELD_NUMBER
      See Also:
    • DISABLE_STANDARD_CEL_DECLARATIONS_FIELD_NUMBER

      public static final int DISABLE_STANDARD_CEL_DECLARATIONS_FIELD_NUMBER
      See Also:
    • MESSAGE_TYPE_EXTENSION_FIELD_NUMBER

      public static final int MESSAGE_TYPE_EXTENSION_FIELD_NUMBER
      See Also:
    • ENABLE_MACRO_CALL_TRACKING_FIELD_NUMBER

      public static final int ENABLE_MACRO_CALL_TRACKING_FIELD_NUMBER
      See Also:
  • Method Details

    • newInstance

      protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
      Overrides:
      newInstance in class com.google.protobuf.GeneratedMessageV3
    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
    • getName

      public String getName()
       Name of the environment
       
      string name = 1;
      Specified by:
      getName in interface EnvironmentOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       Name of the environment
       
      string name = 1;
      Specified by:
      getNameBytes in interface EnvironmentOrBuilder
      Returns:
      The bytes for name.
    • getDescription

      public String getDescription()
       Description for the current environment
       
      string description = 2;
      Specified by:
      getDescription in interface EnvironmentOrBuilder
      Returns:
      The description.
    • getDescriptionBytes

      public com.google.protobuf.ByteString getDescriptionBytes()
       Description for the current environment
       
      string description = 2;
      Specified by:
      getDescriptionBytes in interface EnvironmentOrBuilder
      Returns:
      The bytes for description.
    • getContainer

      public String getContainer()
       Sets the namespace (container) for the expression.
       This is used to simplify resolution.
       For example with container
         `google.rpc.context`
        an identifier of `google.rpc.context.AttributeContext` could be referred
        to simply as `AttributeContext` in the CEL expression.
       
      string container = 3;
      Specified by:
      getContainer in interface EnvironmentOrBuilder
      Returns:
      The container.
    • getContainerBytes

      public com.google.protobuf.ByteString getContainerBytes()
       Sets the namespace (container) for the expression.
       This is used to simplify resolution.
       For example with container
         `google.rpc.context`
        an identifier of `google.rpc.context.AttributeContext` could be referred
        to simply as `AttributeContext` in the CEL expression.
       
      string container = 3;
      Specified by:
      getContainerBytes in interface EnvironmentOrBuilder
      Returns:
      The bytes for container.
    • getImportsList

      public List<Environment.Import> getImportsList()
       List of abbreviations to be added to the CEL environment
       
      repeated .cel.expr.conformance.Environment.Import imports = 4;
      Specified by:
      getImportsList in interface EnvironmentOrBuilder
    • getImportsOrBuilderList

      public List<? extends Environment.ImportOrBuilder> getImportsOrBuilderList()
       List of abbreviations to be added to the CEL environment
       
      repeated .cel.expr.conformance.Environment.Import imports = 4;
      Specified by:
      getImportsOrBuilderList in interface EnvironmentOrBuilder
    • getImportsCount

      public int getImportsCount()
       List of abbreviations to be added to the CEL environment
       
      repeated .cel.expr.conformance.Environment.Import imports = 4;
      Specified by:
      getImportsCount in interface EnvironmentOrBuilder
    • getImports

      public Environment.Import getImports(int index)
       List of abbreviations to be added to the CEL environment
       
      repeated .cel.expr.conformance.Environment.Import imports = 4;
      Specified by:
      getImports in interface EnvironmentOrBuilder
    • getImportsOrBuilder

      public Environment.ImportOrBuilder getImportsOrBuilder(int index)
       List of abbreviations to be added to the CEL environment
       
      repeated .cel.expr.conformance.Environment.Import imports = 4;
      Specified by:
      getImportsOrBuilder in interface EnvironmentOrBuilder
    • hasStdlib

      public boolean hasStdlib()
       Set of options to subset a subsettable library
       
      .cel.expr.conformance.LibrarySubset stdlib = 5;
      Specified by:
      hasStdlib in interface EnvironmentOrBuilder
      Returns:
      Whether the stdlib field is set.
    • getStdlib

      public LibrarySubset getStdlib()
       Set of options to subset a subsettable library
       
      .cel.expr.conformance.LibrarySubset stdlib = 5;
      Specified by:
      getStdlib in interface EnvironmentOrBuilder
      Returns:
      The stdlib.
    • getStdlibOrBuilder

      public LibrarySubsetOrBuilder getStdlibOrBuilder()
       Set of options to subset a subsettable library
       
      .cel.expr.conformance.LibrarySubset stdlib = 5;
      Specified by:
      getStdlibOrBuilder in interface EnvironmentOrBuilder
    • getExtensionsList

      public List<Extension> getExtensionsList()
       List of extensions to enable in the CEL environment.
       
      repeated .cel.expr.conformance.Extension extensions = 6;
      Specified by:
      getExtensionsList in interface EnvironmentOrBuilder
    • getExtensionsOrBuilderList

      public List<? extends ExtensionOrBuilder> getExtensionsOrBuilderList()
       List of extensions to enable in the CEL environment.
       
      repeated .cel.expr.conformance.Extension extensions = 6;
      Specified by:
      getExtensionsOrBuilderList in interface EnvironmentOrBuilder
    • getExtensionsCount

      public int getExtensionsCount()
       List of extensions to enable in the CEL environment.
       
      repeated .cel.expr.conformance.Extension extensions = 6;
      Specified by:
      getExtensionsCount in interface EnvironmentOrBuilder
    • getExtensions

      public Extension getExtensions(int index)
       List of extensions to enable in the CEL environment.
       
      repeated .cel.expr.conformance.Extension extensions = 6;
      Specified by:
      getExtensions in interface EnvironmentOrBuilder
    • getExtensionsOrBuilder

      public ExtensionOrBuilder getExtensionsOrBuilder(int index)
       List of extensions to enable in the CEL environment.
       
      repeated .cel.expr.conformance.Extension extensions = 6;
      Specified by:
      getExtensionsOrBuilder in interface EnvironmentOrBuilder
    • hasContextVariable

      public boolean hasContextVariable()
       If set, adds a context declaration from a proto message.
      
       Context messages have all of their top-level fields available as variables
       in the type checker.
       
      .cel.expr.conformance.Environment.ContextVariable context_variable = 7;
      Specified by:
      hasContextVariable in interface EnvironmentOrBuilder
      Returns:
      Whether the contextVariable field is set.
    • getContextVariable

      public Environment.ContextVariable getContextVariable()
       If set, adds a context declaration from a proto message.
      
       Context messages have all of their top-level fields available as variables
       in the type checker.
       
      .cel.expr.conformance.Environment.ContextVariable context_variable = 7;
      Specified by:
      getContextVariable in interface EnvironmentOrBuilder
      Returns:
      The contextVariable.
    • getContextVariableOrBuilder

      public Environment.ContextVariableOrBuilder getContextVariableOrBuilder()
       If set, adds a context declaration from a proto message.
      
       Context messages have all of their top-level fields available as variables
       in the type checker.
       
      .cel.expr.conformance.Environment.ContextVariable context_variable = 7;
      Specified by:
      getContextVariableOrBuilder in interface EnvironmentOrBuilder
    • getDeclarationsList

      public List<Decl> getDeclarationsList()
       List of declarations to be configured in the CEL environment.
      
       Note: The CEL environment can be configured with either the
       context_variable or a set of ident_decls provided as part of declarations.
       Providing both will result in an error.
       
      repeated .cel.expr.Decl declarations = 8;
      Specified by:
      getDeclarationsList in interface EnvironmentOrBuilder
    • getDeclarationsOrBuilderList

      public List<? extends DeclOrBuilder> getDeclarationsOrBuilderList()
       List of declarations to be configured in the CEL environment.
      
       Note: The CEL environment can be configured with either the
       context_variable or a set of ident_decls provided as part of declarations.
       Providing both will result in an error.
       
      repeated .cel.expr.Decl declarations = 8;
      Specified by:
      getDeclarationsOrBuilderList in interface EnvironmentOrBuilder
    • getDeclarationsCount

      public int getDeclarationsCount()
       List of declarations to be configured in the CEL environment.
      
       Note: The CEL environment can be configured with either the
       context_variable or a set of ident_decls provided as part of declarations.
       Providing both will result in an error.
       
      repeated .cel.expr.Decl declarations = 8;
      Specified by:
      getDeclarationsCount in interface EnvironmentOrBuilder
    • getDeclarations

      public Decl getDeclarations(int index)
       List of declarations to be configured in the CEL environment.
      
       Note: The CEL environment can be configured with either the
       context_variable or a set of ident_decls provided as part of declarations.
       Providing both will result in an error.
       
      repeated .cel.expr.Decl declarations = 8;
      Specified by:
      getDeclarations in interface EnvironmentOrBuilder
    • getDeclarationsOrBuilder

      public DeclOrBuilder getDeclarationsOrBuilder(int index)
       List of declarations to be configured in the CEL environment.
      
       Note: The CEL environment can be configured with either the
       context_variable or a set of ident_decls provided as part of declarations.
       Providing both will result in an error.
       
      repeated .cel.expr.Decl declarations = 8;
      Specified by:
      getDeclarationsOrBuilder in interface EnvironmentOrBuilder
    • getValidatorsList

      public List<Validator> getValidatorsList()
       List of validators for validating the parsed ast.
       
      repeated .cel.expr.conformance.Validator validators = 9;
      Specified by:
      getValidatorsList in interface EnvironmentOrBuilder
    • getValidatorsOrBuilderList

      public List<? extends ValidatorOrBuilder> getValidatorsOrBuilderList()
       List of validators for validating the parsed ast.
       
      repeated .cel.expr.conformance.Validator validators = 9;
      Specified by:
      getValidatorsOrBuilderList in interface EnvironmentOrBuilder
    • getValidatorsCount

      public int getValidatorsCount()
       List of validators for validating the parsed ast.
       
      repeated .cel.expr.conformance.Validator validators = 9;
      Specified by:
      getValidatorsCount in interface EnvironmentOrBuilder
    • getValidators

      public Validator getValidators(int index)
       List of validators for validating the parsed ast.
       
      repeated .cel.expr.conformance.Validator validators = 9;
      Specified by:
      getValidators in interface EnvironmentOrBuilder
    • getValidatorsOrBuilder

      public ValidatorOrBuilder getValidatorsOrBuilder(int index)
       List of validators for validating the parsed ast.
       
      repeated .cel.expr.conformance.Validator validators = 9;
      Specified by:
      getValidatorsOrBuilder in interface EnvironmentOrBuilder
    • getFeaturesList

      public List<Feature> getFeaturesList()
       List of feature flags to be enabled or disabled.
       
      repeated .cel.expr.conformance.Feature features = 10;
      Specified by:
      getFeaturesList in interface EnvironmentOrBuilder
    • getFeaturesOrBuilderList

      public List<? extends FeatureOrBuilder> getFeaturesOrBuilderList()
       List of feature flags to be enabled or disabled.
       
      repeated .cel.expr.conformance.Feature features = 10;
      Specified by:
      getFeaturesOrBuilderList in interface EnvironmentOrBuilder
    • getFeaturesCount

      public int getFeaturesCount()
       List of feature flags to be enabled or disabled.
       
      repeated .cel.expr.conformance.Feature features = 10;
      Specified by:
      getFeaturesCount in interface EnvironmentOrBuilder
    • getFeatures

      public Feature getFeatures(int index)
       List of feature flags to be enabled or disabled.
       
      repeated .cel.expr.conformance.Feature features = 10;
      Specified by:
      getFeatures in interface EnvironmentOrBuilder
    • getFeaturesOrBuilder

      public FeatureOrBuilder getFeaturesOrBuilder(int index)
       List of feature flags to be enabled or disabled.
       
      repeated .cel.expr.conformance.Feature features = 10;
      Specified by:
      getFeaturesOrBuilder in interface EnvironmentOrBuilder
    • getDisableStandardCelDeclarations

      public boolean getDisableStandardCelDeclarations()
       Disables including the declarations from the standard CEL environment.
      
       NOTE: Do not disable the standard CEL declarations unless you are aware of
       the implications and have discussed your use case on cel-discuss@
       or with the members of the cel-governance-team@
      
       Deprecated: Use LibrarySubset to disable standard cel declarations instead:
         stdlib = LibrarySubset{ disable: true }
       
      bool disable_standard_cel_declarations = 11;
      Specified by:
      getDisableStandardCelDeclarations in interface EnvironmentOrBuilder
      Returns:
      The disableStandardCelDeclarations.
    • hasMessageTypeExtension

      public boolean hasMessageTypeExtension()
       If provided, uses the provided FileDescriptorSet to extend types available
       the CEL expression. All "well-known" protobuf messages (google.protobuf.*)
       are known to the CEL compiler, but all others must be provided for type
       checking.
       
      .google.protobuf.FileDescriptorSet message_type_extension = 12;
      Specified by:
      hasMessageTypeExtension in interface EnvironmentOrBuilder
      Returns:
      Whether the messageTypeExtension field is set.
    • getMessageTypeExtension

      public com.google.protobuf.DescriptorProtos.FileDescriptorSet getMessageTypeExtension()
       If provided, uses the provided FileDescriptorSet to extend types available
       the CEL expression. All "well-known" protobuf messages (google.protobuf.*)
       are known to the CEL compiler, but all others must be provided for type
       checking.
       
      .google.protobuf.FileDescriptorSet message_type_extension = 12;
      Specified by:
      getMessageTypeExtension in interface EnvironmentOrBuilder
      Returns:
      The messageTypeExtension.
    • getMessageTypeExtensionOrBuilder

      public com.google.protobuf.DescriptorProtos.FileDescriptorSetOrBuilder getMessageTypeExtensionOrBuilder()
       If provided, uses the provided FileDescriptorSet to extend types available
       the CEL expression. All "well-known" protobuf messages (google.protobuf.*)
       are known to the CEL compiler, but all others must be provided for type
       checking.
       
      .google.protobuf.FileDescriptorSet message_type_extension = 12;
      Specified by:
      getMessageTypeExtensionOrBuilder in interface EnvironmentOrBuilder
    • getEnableMacroCallTracking

      public boolean getEnableMacroCallTracking()
       When macro call tracking is enabled, the resulting SourceInfo in the
       CheckedExpr will contain a collection of expressions representing the
       function calls which were replaced by macros.
      
       Deprecated: Use Feature to enable macro call tracking
        Feature{ name: "cel.feature.macro_call_tracking", enabled: true }
       
      bool enable_macro_call_tracking = 13;
      Specified by:
      getEnableMacroCallTracking in interface EnvironmentOrBuilder
      Returns:
      The enableMacroCallTracking.
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessageV3
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessageV3
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.google.protobuf.AbstractMessage
    • parseFrom

      public static Environment parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Environment parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Environment parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Environment parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Environment parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Environment parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Environment parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Environment parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static Environment parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static Environment parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Environment parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Environment parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilderForType

      public Environment.Builder newBuilderForType()
      Specified by:
      newBuilderForType in interface com.google.protobuf.Message
      Specified by:
      newBuilderForType in interface com.google.protobuf.MessageLite
    • newBuilder

      public static Environment.Builder newBuilder()
    • newBuilder

      public static Environment.Builder newBuilder(Environment prototype)
    • toBuilder

      public Environment.Builder toBuilder()
      Specified by:
      toBuilder in interface com.google.protobuf.Message
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite
    • newBuilderForType

      protected Environment.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
      Specified by:
      newBuilderForType in class com.google.protobuf.GeneratedMessageV3
    • getDefaultInstance

      public static Environment getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<Environment> parser()
    • getParserForType

      public com.google.protobuf.Parser<Environment> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessageV3
    • getDefaultInstanceForType

      public Environment getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder