Class SourceInfo.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<MessageType,BuilderType>
com.google.protobuf.GeneratedMessageLite.Builder<SourceInfo,SourceInfo.Builder>
com.google.api.expr.v1alpha1.SourceInfo.Builder
All Implemented Interfaces:
SourceInfoOrBuilder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, Cloneable
Enclosing class:
SourceInfo

public static final class SourceInfo.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<SourceInfo,SourceInfo.Builder> implements SourceInfoOrBuilder
 Source information collected at parse time.
 
Protobuf type google.api.expr.v1alpha1.SourceInfo
  • Method Details

    • getSyntaxVersion

      public String getSyntaxVersion()
       The syntax version of the source, e.g. `cel1`.
       
      string syntax_version = 1 [json_name = "syntaxVersion"];
      Specified by:
      getSyntaxVersion in interface SourceInfoOrBuilder
      Returns:
      The syntaxVersion.
    • getSyntaxVersionBytes

      public com.google.protobuf.ByteString getSyntaxVersionBytes()
       The syntax version of the source, e.g. `cel1`.
       
      string syntax_version = 1 [json_name = "syntaxVersion"];
      Specified by:
      getSyntaxVersionBytes in interface SourceInfoOrBuilder
      Returns:
      The bytes for syntaxVersion.
    • setSyntaxVersion

      public SourceInfo.Builder setSyntaxVersion(String value)
       The syntax version of the source, e.g. `cel1`.
       
      string syntax_version = 1 [json_name = "syntaxVersion"];
      Parameters:
      value - The syntaxVersion to set.
      Returns:
      This builder for chaining.
    • clearSyntaxVersion

      public SourceInfo.Builder clearSyntaxVersion()
       The syntax version of the source, e.g. `cel1`.
       
      string syntax_version = 1 [json_name = "syntaxVersion"];
      Returns:
      This builder for chaining.
    • setSyntaxVersionBytes

      public SourceInfo.Builder setSyntaxVersionBytes(com.google.protobuf.ByteString value)
       The syntax version of the source, e.g. `cel1`.
       
      string syntax_version = 1 [json_name = "syntaxVersion"];
      Parameters:
      value - The bytes for syntaxVersion to set.
      Returns:
      This builder for chaining.
    • getLocation

      public String getLocation()
       The location name. All position information attached to an expression is
       relative to this location.
      
       The location could be a file, UI element, or similar. For example,
       `acme/app/AnvilPolicy.cel`.
       
      string location = 2 [json_name = "location"];
      Specified by:
      getLocation in interface SourceInfoOrBuilder
      Returns:
      The location.
    • getLocationBytes

      public com.google.protobuf.ByteString getLocationBytes()
       The location name. All position information attached to an expression is
       relative to this location.
      
       The location could be a file, UI element, or similar. For example,
       `acme/app/AnvilPolicy.cel`.
       
      string location = 2 [json_name = "location"];
      Specified by:
      getLocationBytes in interface SourceInfoOrBuilder
      Returns:
      The bytes for location.
    • setLocation

      public SourceInfo.Builder setLocation(String value)
       The location name. All position information attached to an expression is
       relative to this location.
      
       The location could be a file, UI element, or similar. For example,
       `acme/app/AnvilPolicy.cel`.
       
      string location = 2 [json_name = "location"];
      Parameters:
      value - The location to set.
      Returns:
      This builder for chaining.
    • clearLocation

      public SourceInfo.Builder clearLocation()
       The location name. All position information attached to an expression is
       relative to this location.
      
       The location could be a file, UI element, or similar. For example,
       `acme/app/AnvilPolicy.cel`.
       
      string location = 2 [json_name = "location"];
      Returns:
      This builder for chaining.
    • setLocationBytes

      public SourceInfo.Builder setLocationBytes(com.google.protobuf.ByteString value)
       The location name. All position information attached to an expression is
       relative to this location.
      
       The location could be a file, UI element, or similar. For example,
       `acme/app/AnvilPolicy.cel`.
       
      string location = 2 [json_name = "location"];
      Parameters:
      value - The bytes for location to set.
      Returns:
      This builder for chaining.
    • getLineOffsetsList

      public List<Integer> getLineOffsetsList()
       Monotonically increasing list of code point offsets where newlines
       `\n` appear.
      
       The line number of a given position is the index `i` where for a given
       `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The
       column may be derivd from `id_positions[id] - line_offsets[i]`.
       
      repeated int32 line_offsets = 3 [json_name = "lineOffsets"];
      Specified by:
      getLineOffsetsList in interface SourceInfoOrBuilder
      Returns:
      A list containing the lineOffsets.
    • getLineOffsetsCount

      public int getLineOffsetsCount()
       Monotonically increasing list of code point offsets where newlines
       `\n` appear.
      
       The line number of a given position is the index `i` where for a given
       `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The
       column may be derivd from `id_positions[id] - line_offsets[i]`.
       
      repeated int32 line_offsets = 3 [json_name = "lineOffsets"];
      Specified by:
      getLineOffsetsCount in interface SourceInfoOrBuilder
      Returns:
      The count of lineOffsets.
    • getLineOffsets

      public int getLineOffsets(int index)
       Monotonically increasing list of code point offsets where newlines
       `\n` appear.
      
       The line number of a given position is the index `i` where for a given
       `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The
       column may be derivd from `id_positions[id] - line_offsets[i]`.
       
      repeated int32 line_offsets = 3 [json_name = "lineOffsets"];
      Specified by:
      getLineOffsets in interface SourceInfoOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The lineOffsets at the given index.
    • setLineOffsets

      public SourceInfo.Builder setLineOffsets(int index, int value)
       Monotonically increasing list of code point offsets where newlines
       `\n` appear.
      
       The line number of a given position is the index `i` where for a given
       `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The
       column may be derivd from `id_positions[id] - line_offsets[i]`.
       
      repeated int32 line_offsets = 3 [json_name = "lineOffsets"];
      Parameters:
      value - The lineOffsets to set.
      Returns:
      This builder for chaining.
    • addLineOffsets

      public SourceInfo.Builder addLineOffsets(int value)
       Monotonically increasing list of code point offsets where newlines
       `\n` appear.
      
       The line number of a given position is the index `i` where for a given
       `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The
       column may be derivd from `id_positions[id] - line_offsets[i]`.
       
      repeated int32 line_offsets = 3 [json_name = "lineOffsets"];
      Parameters:
      value - The lineOffsets to add.
      Returns:
      This builder for chaining.
    • addAllLineOffsets

      public SourceInfo.Builder addAllLineOffsets(Iterable<? extends Integer> values)
       Monotonically increasing list of code point offsets where newlines
       `\n` appear.
      
       The line number of a given position is the index `i` where for a given
       `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The
       column may be derivd from `id_positions[id] - line_offsets[i]`.
       
      repeated int32 line_offsets = 3 [json_name = "lineOffsets"];
      Parameters:
      values - The lineOffsets to add.
      Returns:
      This builder for chaining.
    • clearLineOffsets

      public SourceInfo.Builder clearLineOffsets()
       Monotonically increasing list of code point offsets where newlines
       `\n` appear.
      
       The line number of a given position is the index `i` where for a given
       `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The
       column may be derivd from `id_positions[id] - line_offsets[i]`.
       
      repeated int32 line_offsets = 3 [json_name = "lineOffsets"];
      Returns:
      This builder for chaining.
    • getPositionsCount

      public int getPositionsCount()
      Description copied from interface: SourceInfoOrBuilder
       A map from the parse node id (e.g. `Expr.id`) to the code point offset
       within the source.
       
      map<int64, int32> positions = 4 [json_name = "positions"];
      Specified by:
      getPositionsCount in interface SourceInfoOrBuilder
    • containsPositions

      public boolean containsPositions(long key)
       A map from the parse node id (e.g. `Expr.id`) to the code point offset
       within the source.
       
      map<int64, int32> positions = 4 [json_name = "positions"];
      Specified by:
      containsPositions in interface SourceInfoOrBuilder
    • clearPositions

      public SourceInfo.Builder clearPositions()
    • removePositions

      public SourceInfo.Builder removePositions(long key)
       A map from the parse node id (e.g. `Expr.id`) to the code point offset
       within the source.
       
      map<int64, int32> positions = 4 [json_name = "positions"];
    • getPositions

      @Deprecated public Map<Long,Integer> getPositions()
      Deprecated.
      Use getPositionsMap() instead.
      Specified by:
      getPositions in interface SourceInfoOrBuilder
    • getPositionsMap

      public Map<Long,Integer> getPositionsMap()
       A map from the parse node id (e.g. `Expr.id`) to the code point offset
       within the source.
       
      map<int64, int32> positions = 4 [json_name = "positions"];
      Specified by:
      getPositionsMap in interface SourceInfoOrBuilder
    • getPositionsOrDefault

      public int getPositionsOrDefault(long key, int defaultValue)
       A map from the parse node id (e.g. `Expr.id`) to the code point offset
       within the source.
       
      map<int64, int32> positions = 4 [json_name = "positions"];
      Specified by:
      getPositionsOrDefault in interface SourceInfoOrBuilder
    • getPositionsOrThrow

      public int getPositionsOrThrow(long key)
       A map from the parse node id (e.g. `Expr.id`) to the code point offset
       within the source.
       
      map<int64, int32> positions = 4 [json_name = "positions"];
      Specified by:
      getPositionsOrThrow in interface SourceInfoOrBuilder
    • putPositions

      public SourceInfo.Builder putPositions(long key, int value)
       A map from the parse node id (e.g. `Expr.id`) to the code point offset
       within the source.
       
      map<int64, int32> positions = 4 [json_name = "positions"];
    • putAllPositions

      public SourceInfo.Builder putAllPositions(Map<Long,Integer> values)
       A map from the parse node id (e.g. `Expr.id`) to the code point offset
       within the source.
       
      map<int64, int32> positions = 4 [json_name = "positions"];
    • getMacroCallsCount

      public int getMacroCallsCount()
      Description copied from interface: SourceInfoOrBuilder
       A map from the parse node id where a macro replacement was made to the
       call `Expr` that resulted in a macro expansion.
      
       For example, `has(value.field)` is a function call that is replaced by a
       `test_only` field selection in the AST. Likewise, the call
       `list.exists(e, e > 10)` translates to a comprehension expression. The key
       in the map corresponds to the expression id of the expanded macro, and the
       value is the call `Expr` that was replaced.
       
      map<int64, .google.api.expr.v1alpha1.Expr> macro_calls = 5 [json_name = "macroCalls"];
      Specified by:
      getMacroCallsCount in interface SourceInfoOrBuilder
    • containsMacroCalls

      public boolean containsMacroCalls(long key)
       A map from the parse node id where a macro replacement was made to the
       call `Expr` that resulted in a macro expansion.
      
       For example, `has(value.field)` is a function call that is replaced by a
       `test_only` field selection in the AST. Likewise, the call
       `list.exists(e, e > 10)` translates to a comprehension expression. The key
       in the map corresponds to the expression id of the expanded macro, and the
       value is the call `Expr` that was replaced.
       
      map<int64, .google.api.expr.v1alpha1.Expr> macro_calls = 5 [json_name = "macroCalls"];
      Specified by:
      containsMacroCalls in interface SourceInfoOrBuilder
    • clearMacroCalls

      public SourceInfo.Builder clearMacroCalls()
    • removeMacroCalls

      public SourceInfo.Builder removeMacroCalls(long key)
       A map from the parse node id where a macro replacement was made to the
       call `Expr` that resulted in a macro expansion.
      
       For example, `has(value.field)` is a function call that is replaced by a
       `test_only` field selection in the AST. Likewise, the call
       `list.exists(e, e > 10)` translates to a comprehension expression. The key
       in the map corresponds to the expression id of the expanded macro, and the
       value is the call `Expr` that was replaced.
       
      map<int64, .google.api.expr.v1alpha1.Expr> macro_calls = 5 [json_name = "macroCalls"];
    • getMacroCalls

      @Deprecated public Map<Long,Expr> getMacroCalls()
      Deprecated.
      Use getMacroCallsMap() instead.
      Specified by:
      getMacroCalls in interface SourceInfoOrBuilder
    • getMacroCallsMap

      public Map<Long,Expr> getMacroCallsMap()
       A map from the parse node id where a macro replacement was made to the
       call `Expr` that resulted in a macro expansion.
      
       For example, `has(value.field)` is a function call that is replaced by a
       `test_only` field selection in the AST. Likewise, the call
       `list.exists(e, e > 10)` translates to a comprehension expression. The key
       in the map corresponds to the expression id of the expanded macro, and the
       value is the call `Expr` that was replaced.
       
      map<int64, .google.api.expr.v1alpha1.Expr> macro_calls = 5 [json_name = "macroCalls"];
      Specified by:
      getMacroCallsMap in interface SourceInfoOrBuilder
    • getMacroCallsOrDefault

      public Expr getMacroCallsOrDefault(long key, Expr defaultValue)
       A map from the parse node id where a macro replacement was made to the
       call `Expr` that resulted in a macro expansion.
      
       For example, `has(value.field)` is a function call that is replaced by a
       `test_only` field selection in the AST. Likewise, the call
       `list.exists(e, e > 10)` translates to a comprehension expression. The key
       in the map corresponds to the expression id of the expanded macro, and the
       value is the call `Expr` that was replaced.
       
      map<int64, .google.api.expr.v1alpha1.Expr> macro_calls = 5 [json_name = "macroCalls"];
      Specified by:
      getMacroCallsOrDefault in interface SourceInfoOrBuilder
    • getMacroCallsOrThrow

      public Expr getMacroCallsOrThrow(long key)
       A map from the parse node id where a macro replacement was made to the
       call `Expr` that resulted in a macro expansion.
      
       For example, `has(value.field)` is a function call that is replaced by a
       `test_only` field selection in the AST. Likewise, the call
       `list.exists(e, e > 10)` translates to a comprehension expression. The key
       in the map corresponds to the expression id of the expanded macro, and the
       value is the call `Expr` that was replaced.
       
      map<int64, .google.api.expr.v1alpha1.Expr> macro_calls = 5 [json_name = "macroCalls"];
      Specified by:
      getMacroCallsOrThrow in interface SourceInfoOrBuilder
    • putMacroCalls

      public SourceInfo.Builder putMacroCalls(long key, Expr value)
       A map from the parse node id where a macro replacement was made to the
       call `Expr` that resulted in a macro expansion.
      
       For example, `has(value.field)` is a function call that is replaced by a
       `test_only` field selection in the AST. Likewise, the call
       `list.exists(e, e > 10)` translates to a comprehension expression. The key
       in the map corresponds to the expression id of the expanded macro, and the
       value is the call `Expr` that was replaced.
       
      map<int64, .google.api.expr.v1alpha1.Expr> macro_calls = 5 [json_name = "macroCalls"];
    • putAllMacroCalls

      public SourceInfo.Builder putAllMacroCalls(Map<Long,Expr> values)
       A map from the parse node id where a macro replacement was made to the
       call `Expr` that resulted in a macro expansion.
      
       For example, `has(value.field)` is a function call that is replaced by a
       `test_only` field selection in the AST. Likewise, the call
       `list.exists(e, e > 10)` translates to a comprehension expression. The key
       in the map corresponds to the expression id of the expanded macro, and the
       value is the call `Expr` that was replaced.
       
      map<int64, .google.api.expr.v1alpha1.Expr> macro_calls = 5 [json_name = "macroCalls"];
    • getExtensionsList

      public List<SourceInfo.Extension> getExtensionsList()
       A list of tags for extensions that were used while parsing or type checking
       the source expression. For example, optimizations that require special
       runtime support may be specified.
      
       These are used to check feature support between components in separate
       implementations. This can be used to either skip redundant work or
       report an error if the extension is unsupported.
       
      repeated .google.api.expr.v1alpha1.SourceInfo.Extension extensions = 6 [json_name = "extensions"];
      Specified by:
      getExtensionsList in interface SourceInfoOrBuilder
    • getExtensionsCount

      public int getExtensionsCount()
       A list of tags for extensions that were used while parsing or type checking
       the source expression. For example, optimizations that require special
       runtime support may be specified.
      
       These are used to check feature support between components in separate
       implementations. This can be used to either skip redundant work or
       report an error if the extension is unsupported.
       
      repeated .google.api.expr.v1alpha1.SourceInfo.Extension extensions = 6 [json_name = "extensions"];
      Specified by:
      getExtensionsCount in interface SourceInfoOrBuilder
    • getExtensions

      public SourceInfo.Extension getExtensions(int index)
       A list of tags for extensions that were used while parsing or type checking
       the source expression. For example, optimizations that require special
       runtime support may be specified.
      
       These are used to check feature support between components in separate
       implementations. This can be used to either skip redundant work or
       report an error if the extension is unsupported.
       
      repeated .google.api.expr.v1alpha1.SourceInfo.Extension extensions = 6 [json_name = "extensions"];
      Specified by:
      getExtensions in interface SourceInfoOrBuilder
    • setExtensions

      public SourceInfo.Builder setExtensions(int index, SourceInfo.Extension value)
       A list of tags for extensions that were used while parsing or type checking
       the source expression. For example, optimizations that require special
       runtime support may be specified.
      
       These are used to check feature support between components in separate
       implementations. This can be used to either skip redundant work or
       report an error if the extension is unsupported.
       
      repeated .google.api.expr.v1alpha1.SourceInfo.Extension extensions = 6 [json_name = "extensions"];
    • setExtensions

      public SourceInfo.Builder setExtensions(int index, SourceInfo.Extension.Builder builderForValue)
       A list of tags for extensions that were used while parsing or type checking
       the source expression. For example, optimizations that require special
       runtime support may be specified.
      
       These are used to check feature support between components in separate
       implementations. This can be used to either skip redundant work or
       report an error if the extension is unsupported.
       
      repeated .google.api.expr.v1alpha1.SourceInfo.Extension extensions = 6 [json_name = "extensions"];
    • addExtensions

      public SourceInfo.Builder addExtensions(SourceInfo.Extension value)
       A list of tags for extensions that were used while parsing or type checking
       the source expression. For example, optimizations that require special
       runtime support may be specified.
      
       These are used to check feature support between components in separate
       implementations. This can be used to either skip redundant work or
       report an error if the extension is unsupported.
       
      repeated .google.api.expr.v1alpha1.SourceInfo.Extension extensions = 6 [json_name = "extensions"];
    • addExtensions

      public SourceInfo.Builder addExtensions(int index, SourceInfo.Extension value)
       A list of tags for extensions that were used while parsing or type checking
       the source expression. For example, optimizations that require special
       runtime support may be specified.
      
       These are used to check feature support between components in separate
       implementations. This can be used to either skip redundant work or
       report an error if the extension is unsupported.
       
      repeated .google.api.expr.v1alpha1.SourceInfo.Extension extensions = 6 [json_name = "extensions"];
    • addExtensions

      public SourceInfo.Builder addExtensions(SourceInfo.Extension.Builder builderForValue)
       A list of tags for extensions that were used while parsing or type checking
       the source expression. For example, optimizations that require special
       runtime support may be specified.
      
       These are used to check feature support between components in separate
       implementations. This can be used to either skip redundant work or
       report an error if the extension is unsupported.
       
      repeated .google.api.expr.v1alpha1.SourceInfo.Extension extensions = 6 [json_name = "extensions"];
    • addExtensions

      public SourceInfo.Builder addExtensions(int index, SourceInfo.Extension.Builder builderForValue)
       A list of tags for extensions that were used while parsing or type checking
       the source expression. For example, optimizations that require special
       runtime support may be specified.
      
       These are used to check feature support between components in separate
       implementations. This can be used to either skip redundant work or
       report an error if the extension is unsupported.
       
      repeated .google.api.expr.v1alpha1.SourceInfo.Extension extensions = 6 [json_name = "extensions"];
    • addAllExtensions

      public SourceInfo.Builder addAllExtensions(Iterable<? extends SourceInfo.Extension> values)
       A list of tags for extensions that were used while parsing or type checking
       the source expression. For example, optimizations that require special
       runtime support may be specified.
      
       These are used to check feature support between components in separate
       implementations. This can be used to either skip redundant work or
       report an error if the extension is unsupported.
       
      repeated .google.api.expr.v1alpha1.SourceInfo.Extension extensions = 6 [json_name = "extensions"];
    • clearExtensions

      public SourceInfo.Builder clearExtensions()
       A list of tags for extensions that were used while parsing or type checking
       the source expression. For example, optimizations that require special
       runtime support may be specified.
      
       These are used to check feature support between components in separate
       implementations. This can be used to either skip redundant work or
       report an error if the extension is unsupported.
       
      repeated .google.api.expr.v1alpha1.SourceInfo.Extension extensions = 6 [json_name = "extensions"];
    • removeExtensions

      public SourceInfo.Builder removeExtensions(int index)
       A list of tags for extensions that were used while parsing or type checking
       the source expression. For example, optimizations that require special
       runtime support may be specified.
      
       These are used to check feature support between components in separate
       implementations. This can be used to either skip redundant work or
       report an error if the extension is unsupported.
       
      repeated .google.api.expr.v1alpha1.SourceInfo.Extension extensions = 6 [json_name = "extensions"];