![JAR search and dependency download from the Maven repository](/logo.png)
com.google.api.expr.v1alpha1.SourceInfo Maven / Gradle / Ivy
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/api/expr/v1alpha1/syntax.proto
// Protobuf Java Version: 3.25.5
package com.google.api.expr.v1alpha1;
/**
*
* Source information collected at parse time.
*
*
* Protobuf type {@code google.api.expr.v1alpha1.SourceInfo}
*/
public final class SourceInfo extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.api.expr.v1alpha1.SourceInfo)
SourceInfoOrBuilder {
private static final long serialVersionUID = 0L;
// Use SourceInfo.newBuilder() to construct.
private SourceInfo(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private SourceInfo() {
syntaxVersion_ = "";
location_ = "";
lineOffsets_ = emptyIntList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new SourceInfo();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.api.expr.v1alpha1.SyntaxProto.internal_static_google_api_expr_v1alpha1_SourceInfo_descriptor;
}
@SuppressWarnings({"rawtypes"})
@java.lang.Override
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case 4:
return internalGetPositions();
case 5:
return internalGetMacroCalls();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.api.expr.v1alpha1.SyntaxProto.internal_static_google_api_expr_v1alpha1_SourceInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.api.expr.v1alpha1.SourceInfo.class, com.google.api.expr.v1alpha1.SourceInfo.Builder.class);
}
public static final int SYNTAX_VERSION_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object syntaxVersion_ = "";
/**
*
* The syntax version of the source, e.g. `cel1`.
*
*
* string syntax_version = 1;
* @return The syntaxVersion.
*/
@java.lang.Override
public java.lang.String getSyntaxVersion() {
java.lang.Object ref = syntaxVersion_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
syntaxVersion_ = s;
return s;
}
}
/**
*
* The syntax version of the source, e.g. `cel1`.
*
*
* string syntax_version = 1;
* @return The bytes for syntaxVersion.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getSyntaxVersionBytes() {
java.lang.Object ref = syntaxVersion_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
syntaxVersion_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int LOCATION_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private volatile java.lang.Object location_ = "";
/**
*
* 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;
* @return The location.
*/
@java.lang.Override
public java.lang.String getLocation() {
java.lang.Object ref = location_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
location_ = s;
return s;
}
}
/**
*
* 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;
* @return The bytes for location.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getLocationBytes() {
java.lang.Object ref = location_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
location_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int LINE_OFFSETS_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private com.google.protobuf.Internal.IntList lineOffsets_ =
emptyIntList();
/**
*
* 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;
* @return A list containing the lineOffsets.
*/
@java.lang.Override
public java.util.List
getLineOffsetsList() {
return lineOffsets_;
}
/**
*
* 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;
* @return The count of lineOffsets.
*/
public int getLineOffsetsCount() {
return lineOffsets_.size();
}
/**
*
* 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;
* @param index The index of the element to return.
* @return The lineOffsets at the given index.
*/
public int getLineOffsets(int index) {
return lineOffsets_.getInt(index);
}
private int lineOffsetsMemoizedSerializedSize = -1;
public static final int POSITIONS_FIELD_NUMBER = 4;
private static final class PositionsDefaultEntryHolder {
static final com.google.protobuf.MapEntry<
java.lang.Long, java.lang.Integer> defaultEntry =
com.google.protobuf.MapEntry
.newDefaultInstance(
com.google.api.expr.v1alpha1.SyntaxProto.internal_static_google_api_expr_v1alpha1_SourceInfo_PositionsEntry_descriptor,
com.google.protobuf.WireFormat.FieldType.INT64,
0L,
com.google.protobuf.WireFormat.FieldType.INT32,
0);
}
@SuppressWarnings("serial")
private com.google.protobuf.MapField<
java.lang.Long, java.lang.Integer> positions_;
private com.google.protobuf.MapField
internalGetPositions() {
if (positions_ == null) {
return com.google.protobuf.MapField.emptyMapField(
PositionsDefaultEntryHolder.defaultEntry);
}
return positions_;
}
public int getPositionsCount() {
return internalGetPositions().getMap().size();
}
/**
*
* A map from the parse node id (e.g. `Expr.id`) to the code point offset
* within the source.
*
*
* map<int64, int32> positions = 4;
*/
@java.lang.Override
public boolean containsPositions(
long key) {
return internalGetPositions().getMap().containsKey(key);
}
/**
* Use {@link #getPositionsMap()} instead.
*/
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getPositions() {
return 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;
*/
@java.lang.Override
public java.util.Map getPositionsMap() {
return internalGetPositions().getMap();
}
/**
*
* A map from the parse node id (e.g. `Expr.id`) to the code point offset
* within the source.
*
*
* map<int64, int32> positions = 4;
*/
@java.lang.Override
public int getPositionsOrDefault(
long key,
int defaultValue) {
java.util.Map map =
internalGetPositions().getMap();
return map.containsKey(key) ? map.get(key) : 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;
*/
@java.lang.Override
public int getPositionsOrThrow(
long key) {
java.util.Map map =
internalGetPositions().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public static final int MACRO_CALLS_FIELD_NUMBER = 5;
private static final class MacroCallsDefaultEntryHolder {
static final com.google.protobuf.MapEntry<
java.lang.Long, com.google.api.expr.v1alpha1.Expr> defaultEntry =
com.google.protobuf.MapEntry
.newDefaultInstance(
com.google.api.expr.v1alpha1.SyntaxProto.internal_static_google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_descriptor,
com.google.protobuf.WireFormat.FieldType.INT64,
0L,
com.google.protobuf.WireFormat.FieldType.MESSAGE,
com.google.api.expr.v1alpha1.Expr.getDefaultInstance());
}
@SuppressWarnings("serial")
private com.google.protobuf.MapField<
java.lang.Long, com.google.api.expr.v1alpha1.Expr> macroCalls_;
private com.google.protobuf.MapField
internalGetMacroCalls() {
if (macroCalls_ == null) {
return com.google.protobuf.MapField.emptyMapField(
MacroCallsDefaultEntryHolder.defaultEntry);
}
return macroCalls_;
}
public int getMacroCallsCount() {
return internalGetMacroCalls().getMap().size();
}
/**
*
* 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;
*/
@java.lang.Override
public boolean containsMacroCalls(
long key) {
return internalGetMacroCalls().getMap().containsKey(key);
}
/**
* Use {@link #getMacroCallsMap()} instead.
*/
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getMacroCalls() {
return 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;
*/
@java.lang.Override
public java.util.Map getMacroCallsMap() {
return internalGetMacroCalls().getMap();
}
/**
*
* 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;
*/
@java.lang.Override
public /* nullable */
com.google.api.expr.v1alpha1.Expr getMacroCallsOrDefault(
long key,
/* nullable */
com.google.api.expr.v1alpha1.Expr defaultValue) {
java.util.Map map =
internalGetMacroCalls().getMap();
return map.containsKey(key) ? map.get(key) : 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;
*/
@java.lang.Override
public com.google.api.expr.v1alpha1.Expr getMacroCallsOrThrow(
long key) {
java.util.Map map =
internalGetMacroCalls().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(syntaxVersion_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, syntaxVersion_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, location_);
}
if (getLineOffsetsList().size() > 0) {
output.writeUInt32NoTag(26);
output.writeUInt32NoTag(lineOffsetsMemoizedSerializedSize);
}
for (int i = 0; i < lineOffsets_.size(); i++) {
output.writeInt32NoTag(lineOffsets_.getInt(i));
}
com.google.protobuf.GeneratedMessageV3
.serializeLongMapTo(
output,
internalGetPositions(),
PositionsDefaultEntryHolder.defaultEntry,
4);
com.google.protobuf.GeneratedMessageV3
.serializeLongMapTo(
output,
internalGetMacroCalls(),
MacroCallsDefaultEntryHolder.defaultEntry,
5);
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(syntaxVersion_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, syntaxVersion_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, location_);
}
{
int dataSize = 0;
for (int i = 0; i < lineOffsets_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(lineOffsets_.getInt(i));
}
size += dataSize;
if (!getLineOffsetsList().isEmpty()) {
size += 1;
size += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(dataSize);
}
lineOffsetsMemoizedSerializedSize = dataSize;
}
for (java.util.Map.Entry entry
: internalGetPositions().getMap().entrySet()) {
com.google.protobuf.MapEntry
positions__ = PositionsDefaultEntryHolder.defaultEntry.newBuilderForType()
.setKey(entry.getKey())
.setValue(entry.getValue())
.build();
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, positions__);
}
for (java.util.Map.Entry entry
: internalGetMacroCalls().getMap().entrySet()) {
com.google.protobuf.MapEntry
macroCalls__ = MacroCallsDefaultEntryHolder.defaultEntry.newBuilderForType()
.setKey(entry.getKey())
.setValue(entry.getValue())
.build();
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(5, macroCalls__);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.api.expr.v1alpha1.SourceInfo)) {
return super.equals(obj);
}
com.google.api.expr.v1alpha1.SourceInfo other = (com.google.api.expr.v1alpha1.SourceInfo) obj;
if (!getSyntaxVersion()
.equals(other.getSyntaxVersion())) return false;
if (!getLocation()
.equals(other.getLocation())) return false;
if (!getLineOffsetsList()
.equals(other.getLineOffsetsList())) return false;
if (!internalGetPositions().equals(
other.internalGetPositions())) return false;
if (!internalGetMacroCalls().equals(
other.internalGetMacroCalls())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + SYNTAX_VERSION_FIELD_NUMBER;
hash = (53 * hash) + getSyntaxVersion().hashCode();
hash = (37 * hash) + LOCATION_FIELD_NUMBER;
hash = (53 * hash) + getLocation().hashCode();
if (getLineOffsetsCount() > 0) {
hash = (37 * hash) + LINE_OFFSETS_FIELD_NUMBER;
hash = (53 * hash) + getLineOffsetsList().hashCode();
}
if (!internalGetPositions().getMap().isEmpty()) {
hash = (37 * hash) + POSITIONS_FIELD_NUMBER;
hash = (53 * hash) + internalGetPositions().hashCode();
}
if (!internalGetMacroCalls().getMap().isEmpty()) {
hash = (37 * hash) + MACRO_CALLS_FIELD_NUMBER;
hash = (53 * hash) + internalGetMacroCalls().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.api.expr.v1alpha1.SourceInfo parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.expr.v1alpha1.SourceInfo parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.api.expr.v1alpha1.SourceInfo parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.expr.v1alpha1.SourceInfo parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.api.expr.v1alpha1.SourceInfo parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.expr.v1alpha1.SourceInfo parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.api.expr.v1alpha1.SourceInfo parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.api.expr.v1alpha1.SourceInfo parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.api.expr.v1alpha1.SourceInfo parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.api.expr.v1alpha1.SourceInfo parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.api.expr.v1alpha1.SourceInfo parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.api.expr.v1alpha1.SourceInfo parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.api.expr.v1alpha1.SourceInfo prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* Source information collected at parse time.
*
*
* Protobuf type {@code google.api.expr.v1alpha1.SourceInfo}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:google.api.expr.v1alpha1.SourceInfo)
com.google.api.expr.v1alpha1.SourceInfoOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.api.expr.v1alpha1.SyntaxProto.internal_static_google_api_expr_v1alpha1_SourceInfo_descriptor;
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case 4:
return internalGetPositions();
case 5:
return internalGetMacroCalls();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(
int number) {
switch (number) {
case 4:
return internalGetMutablePositions();
case 5:
return internalGetMutableMacroCalls();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.api.expr.v1alpha1.SyntaxProto.internal_static_google_api_expr_v1alpha1_SourceInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.api.expr.v1alpha1.SourceInfo.class, com.google.api.expr.v1alpha1.SourceInfo.Builder.class);
}
// Construct using com.google.api.expr.v1alpha1.SourceInfo.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
syntaxVersion_ = "";
location_ = "";
lineOffsets_ = emptyIntList();
internalGetMutablePositions().clear();
internalGetMutableMacroCalls().clear();
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.api.expr.v1alpha1.SyntaxProto.internal_static_google_api_expr_v1alpha1_SourceInfo_descriptor;
}
@java.lang.Override
public com.google.api.expr.v1alpha1.SourceInfo getDefaultInstanceForType() {
return com.google.api.expr.v1alpha1.SourceInfo.getDefaultInstance();
}
@java.lang.Override
public com.google.api.expr.v1alpha1.SourceInfo build() {
com.google.api.expr.v1alpha1.SourceInfo result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.api.expr.v1alpha1.SourceInfo buildPartial() {
com.google.api.expr.v1alpha1.SourceInfo result = new com.google.api.expr.v1alpha1.SourceInfo(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(com.google.api.expr.v1alpha1.SourceInfo result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.syntaxVersion_ = syntaxVersion_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.location_ = location_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
lineOffsets_.makeImmutable();
result.lineOffsets_ = lineOffsets_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.positions_ = internalGetPositions();
result.positions_.makeImmutable();
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.macroCalls_ = internalGetMacroCalls().build(MacroCallsDefaultEntryHolder.defaultEntry);
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.api.expr.v1alpha1.SourceInfo) {
return mergeFrom((com.google.api.expr.v1alpha1.SourceInfo)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.api.expr.v1alpha1.SourceInfo other) {
if (other == com.google.api.expr.v1alpha1.SourceInfo.getDefaultInstance()) return this;
if (!other.getSyntaxVersion().isEmpty()) {
syntaxVersion_ = other.syntaxVersion_;
bitField0_ |= 0x00000001;
onChanged();
}
if (!other.getLocation().isEmpty()) {
location_ = other.location_;
bitField0_ |= 0x00000002;
onChanged();
}
if (!other.lineOffsets_.isEmpty()) {
if (lineOffsets_.isEmpty()) {
lineOffsets_ = other.lineOffsets_;
lineOffsets_.makeImmutable();
bitField0_ |= 0x00000004;
} else {
ensureLineOffsetsIsMutable();
lineOffsets_.addAll(other.lineOffsets_);
}
onChanged();
}
internalGetMutablePositions().mergeFrom(
other.internalGetPositions());
bitField0_ |= 0x00000008;
internalGetMutableMacroCalls().mergeFrom(
other.internalGetMacroCalls());
bitField0_ |= 0x00000010;
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
syntaxVersion_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18: {
location_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 18
case 24: {
int v = input.readInt32();
ensureLineOffsetsIsMutable();
lineOffsets_.addInt(v);
break;
} // case 24
case 26: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
ensureLineOffsetsIsMutable();
while (input.getBytesUntilLimit() > 0) {
lineOffsets_.addInt(input.readInt32());
}
input.popLimit(limit);
break;
} // case 26
case 34: {
com.google.protobuf.MapEntry
positions__ = input.readMessage(
PositionsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
internalGetMutablePositions().getMutableMap().put(
positions__.getKey(), positions__.getValue());
bitField0_ |= 0x00000008;
break;
} // case 34
case 42: {
com.google.protobuf.MapEntry
macroCalls__ = input.readMessage(
MacroCallsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
internalGetMutableMacroCalls().ensureBuilderMap().put(
macroCalls__.getKey(), macroCalls__.getValue());
bitField0_ |= 0x00000010;
break;
} // case 42
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object syntaxVersion_ = "";
/**
*
* The syntax version of the source, e.g. `cel1`.
*
*
* string syntax_version = 1;
* @return The syntaxVersion.
*/
public java.lang.String getSyntaxVersion() {
java.lang.Object ref = syntaxVersion_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
syntaxVersion_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* The syntax version of the source, e.g. `cel1`.
*
*
* string syntax_version = 1;
* @return The bytes for syntaxVersion.
*/
public com.google.protobuf.ByteString
getSyntaxVersionBytes() {
java.lang.Object ref = syntaxVersion_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
syntaxVersion_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The syntax version of the source, e.g. `cel1`.
*
*
* string syntax_version = 1;
* @param value The syntaxVersion to set.
* @return This builder for chaining.
*/
public Builder setSyntaxVersion(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
syntaxVersion_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
* The syntax version of the source, e.g. `cel1`.
*
*
* string syntax_version = 1;
* @return This builder for chaining.
*/
public Builder clearSyntaxVersion() {
syntaxVersion_ = getDefaultInstance().getSyntaxVersion();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
* The syntax version of the source, e.g. `cel1`.
*
*
* string syntax_version = 1;
* @param value The bytes for syntaxVersion to set.
* @return This builder for chaining.
*/
public Builder setSyntaxVersionBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
syntaxVersion_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private java.lang.Object location_ = "";
/**
*
* 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;
* @return The location.
*/
public java.lang.String getLocation() {
java.lang.Object ref = location_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
location_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* 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;
* @return The bytes for location.
*/
public com.google.protobuf.ByteString
getLocationBytes() {
java.lang.Object ref = location_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
location_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* 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;
* @param value The location to set.
* @return This builder for chaining.
*/
public Builder setLocation(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
location_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* 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;
* @return This builder for chaining.
*/
public Builder clearLocation() {
location_ = getDefaultInstance().getLocation();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
/**
*
* 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;
* @param value The bytes for location to set.
* @return This builder for chaining.
*/
public Builder setLocationBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
location_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
private com.google.protobuf.Internal.IntList lineOffsets_ = emptyIntList();
private void ensureLineOffsetsIsMutable() {
if (!lineOffsets_.isModifiable()) {
lineOffsets_ = makeMutableCopy(lineOffsets_);
}
bitField0_ |= 0x00000004;
}
/**
*
* 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;
* @return A list containing the lineOffsets.
*/
public java.util.List
getLineOffsetsList() {
lineOffsets_.makeImmutable();
return lineOffsets_;
}
/**
*
* 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;
* @return The count of lineOffsets.
*/
public int getLineOffsetsCount() {
return lineOffsets_.size();
}
/**
*
* 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;
* @param index The index of the element to return.
* @return The lineOffsets at the given index.
*/
public int getLineOffsets(int index) {
return lineOffsets_.getInt(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;
* @param index The index to set the value at.
* @param value The lineOffsets to set.
* @return This builder for chaining.
*/
public Builder setLineOffsets(
int index, int value) {
ensureLineOffsetsIsMutable();
lineOffsets_.setInt(index, value);
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
* 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;
* @param value The lineOffsets to add.
* @return This builder for chaining.
*/
public Builder addLineOffsets(int value) {
ensureLineOffsetsIsMutable();
lineOffsets_.addInt(value);
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
* 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;
* @param values The lineOffsets to add.
* @return This builder for chaining.
*/
public Builder addAllLineOffsets(
java.lang.Iterable extends java.lang.Integer> values) {
ensureLineOffsetsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, lineOffsets_);
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
* 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;
* @return This builder for chaining.
*/
public Builder clearLineOffsets() {
lineOffsets_ = emptyIntList();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
return this;
}
private com.google.protobuf.MapField<
java.lang.Long, java.lang.Integer> positions_;
private com.google.protobuf.MapField
internalGetPositions() {
if (positions_ == null) {
return com.google.protobuf.MapField.emptyMapField(
PositionsDefaultEntryHolder.defaultEntry);
}
return positions_;
}
private com.google.protobuf.MapField
internalGetMutablePositions() {
if (positions_ == null) {
positions_ = com.google.protobuf.MapField.newMapField(
PositionsDefaultEntryHolder.defaultEntry);
}
if (!positions_.isMutable()) {
positions_ = positions_.copy();
}
bitField0_ |= 0x00000008;
onChanged();
return positions_;
}
public int getPositionsCount() {
return internalGetPositions().getMap().size();
}
/**
*
* A map from the parse node id (e.g. `Expr.id`) to the code point offset
* within the source.
*
*
* map<int64, int32> positions = 4;
*/
@java.lang.Override
public boolean containsPositions(
long key) {
return internalGetPositions().getMap().containsKey(key);
}
/**
* Use {@link #getPositionsMap()} instead.
*/
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getPositions() {
return 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;
*/
@java.lang.Override
public java.util.Map getPositionsMap() {
return internalGetPositions().getMap();
}
/**
*
* A map from the parse node id (e.g. `Expr.id`) to the code point offset
* within the source.
*
*
* map<int64, int32> positions = 4;
*/
@java.lang.Override
public int getPositionsOrDefault(
long key,
int defaultValue) {
java.util.Map map =
internalGetPositions().getMap();
return map.containsKey(key) ? map.get(key) : 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;
*/
@java.lang.Override
public int getPositionsOrThrow(
long key) {
java.util.Map map =
internalGetPositions().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public Builder clearPositions() {
bitField0_ = (bitField0_ & ~0x00000008);
internalGetMutablePositions().getMutableMap()
.clear();
return this;
}
/**
*
* A map from the parse node id (e.g. `Expr.id`) to the code point offset
* within the source.
*
*
* map<int64, int32> positions = 4;
*/
public Builder removePositions(
long key) {
internalGetMutablePositions().getMutableMap()
.remove(key);
return this;
}
/**
* Use alternate mutation accessors instead.
*/
@java.lang.Deprecated
public java.util.Map
getMutablePositions() {
bitField0_ |= 0x00000008;
return internalGetMutablePositions().getMutableMap();
}
/**
*
* A map from the parse node id (e.g. `Expr.id`) to the code point offset
* within the source.
*
*
* map<int64, int32> positions = 4;
*/
public Builder putPositions(
long key,
int value) {
internalGetMutablePositions().getMutableMap()
.put(key, value);
bitField0_ |= 0x00000008;
return this;
}
/**
*
* A map from the parse node id (e.g. `Expr.id`) to the code point offset
* within the source.
*
*
* map<int64, int32> positions = 4;
*/
public Builder putAllPositions(
java.util.Map values) {
internalGetMutablePositions().getMutableMap()
.putAll(values);
bitField0_ |= 0x00000008;
return this;
}
private static final class MacroCallsConverter implements com.google.protobuf.MapFieldBuilder.Converter {
@java.lang.Override
public com.google.api.expr.v1alpha1.Expr build(com.google.api.expr.v1alpha1.ExprOrBuilder val) {
if (val instanceof com.google.api.expr.v1alpha1.Expr) { return (com.google.api.expr.v1alpha1.Expr) val; }
return ((com.google.api.expr.v1alpha1.Expr.Builder) val).build();
}
@java.lang.Override
public com.google.protobuf.MapEntry defaultEntry() {
return MacroCallsDefaultEntryHolder.defaultEntry;
}
};
private static final MacroCallsConverter macroCallsConverter = new MacroCallsConverter();
private com.google.protobuf.MapFieldBuilder<
java.lang.Long, com.google.api.expr.v1alpha1.ExprOrBuilder, com.google.api.expr.v1alpha1.Expr, com.google.api.expr.v1alpha1.Expr.Builder> macroCalls_;
private com.google.protobuf.MapFieldBuilder
internalGetMacroCalls() {
if (macroCalls_ == null) {
return new com.google.protobuf.MapFieldBuilder<>(macroCallsConverter);
}
return macroCalls_;
}
private com.google.protobuf.MapFieldBuilder
internalGetMutableMacroCalls() {
if (macroCalls_ == null) {
macroCalls_ = new com.google.protobuf.MapFieldBuilder<>(macroCallsConverter);
}
bitField0_ |= 0x00000010;
onChanged();
return macroCalls_;
}
public int getMacroCallsCount() {
return internalGetMacroCalls().ensureBuilderMap().size();
}
/**
*
* 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;
*/
@java.lang.Override
public boolean containsMacroCalls(
long key) {
return internalGetMacroCalls().ensureBuilderMap().containsKey(key);
}
/**
* Use {@link #getMacroCallsMap()} instead.
*/
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getMacroCalls() {
return 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;
*/
@java.lang.Override
public java.util.Map getMacroCallsMap() {
return internalGetMacroCalls().getImmutableMap();
}
/**
*
* 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;
*/
@java.lang.Override
public /* nullable */
com.google.api.expr.v1alpha1.Expr getMacroCallsOrDefault(
long key,
/* nullable */
com.google.api.expr.v1alpha1.Expr defaultValue) {
java.util.Map map = internalGetMutableMacroCalls().ensureBuilderMap();
return map.containsKey(key) ? macroCallsConverter.build(map.get(key)) : 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;
*/
@java.lang.Override
public com.google.api.expr.v1alpha1.Expr getMacroCallsOrThrow(
long key) {
java.util.Map map = internalGetMutableMacroCalls().ensureBuilderMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return macroCallsConverter.build(map.get(key));
}
public Builder clearMacroCalls() {
bitField0_ = (bitField0_ & ~0x00000010);
internalGetMutableMacroCalls().clear();
return this;
}
/**
*
* 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;
*/
public Builder removeMacroCalls(
long key) {
internalGetMutableMacroCalls().ensureBuilderMap()
.remove(key);
return this;
}
/**
* Use alternate mutation accessors instead.
*/
@java.lang.Deprecated
public java.util.Map
getMutableMacroCalls() {
bitField0_ |= 0x00000010;
return internalGetMutableMacroCalls().ensureMessageMap();
}
/**
*
* 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;
*/
public Builder putMacroCalls(
long key,
com.google.api.expr.v1alpha1.Expr value) {
if (value == null) { throw new NullPointerException("map value"); }
internalGetMutableMacroCalls().ensureBuilderMap()
.put(key, value);
bitField0_ |= 0x00000010;
return this;
}
/**
*
* 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;
*/
public Builder putAllMacroCalls(
java.util.Map values) {
for (java.util.Map.Entry e : values.entrySet()) {
if (e.getKey() == null || e.getValue() == null) {
throw new NullPointerException();
}
}
internalGetMutableMacroCalls().ensureBuilderMap()
.putAll(values);
bitField0_ |= 0x00000010;
return this;
}
/**
*
* 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;
*/
public com.google.api.expr.v1alpha1.Expr.Builder putMacroCallsBuilderIfAbsent(
long key) {
java.util.Map builderMap = internalGetMutableMacroCalls().ensureBuilderMap();
com.google.api.expr.v1alpha1.ExprOrBuilder entry = builderMap.get(key);
if (entry == null) {
entry = com.google.api.expr.v1alpha1.Expr.newBuilder();
builderMap.put(key, entry);
}
if (entry instanceof com.google.api.expr.v1alpha1.Expr) {
entry = ((com.google.api.expr.v1alpha1.Expr) entry).toBuilder();
builderMap.put(key, entry);
}
return (com.google.api.expr.v1alpha1.Expr.Builder) entry;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.api.expr.v1alpha1.SourceInfo)
}
// @@protoc_insertion_point(class_scope:google.api.expr.v1alpha1.SourceInfo)
private static final com.google.api.expr.v1alpha1.SourceInfo DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.api.expr.v1alpha1.SourceInfo();
}
public static com.google.api.expr.v1alpha1.SourceInfo getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public SourceInfo parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.api.expr.v1alpha1.SourceInfo getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy