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.v1beta1.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.v1beta1.SourceInfo
  • Method Details

    • 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 character offsets where newlines 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 character offsets where newlines 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 character offsets where newlines 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 character offsets where newlines 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 character offsets where newlines 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 character offsets where newlines 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 character offsets where newlines 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 character offset
       within source.
       
      map<int32, int32> positions = 4 [json_name = "positions"];
      Specified by:
      getPositionsCount in interface SourceInfoOrBuilder
    • containsPositions

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

      public SourceInfo.Builder clearPositions()
    • removePositions

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

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

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

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

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

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

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