Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/api/expr/v1alpha1/checked.proto
package com.google.api.expr.v1alpha1;
/**
*
* Represents a declaration of a named value or function.
* A declaration is part of the contract between the expression, the agent
* evaluating that expression, and the caller requesting evaluation.
*
*
* Protobuf type {@code google.api.expr.v1alpha1.Decl}
*/
public final class Decl extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.api.expr.v1alpha1.Decl)
DeclOrBuilder {
private static final long serialVersionUID = 0L;
// Use Decl.newBuilder() to construct.
private Decl(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Decl() {
name_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new Decl();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Decl(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
java.lang.String s = input.readStringRequireUtf8();
name_ = s;
break;
}
case 18: {
com.google.api.expr.v1alpha1.Decl.IdentDecl.Builder subBuilder = null;
if (declKindCase_ == 2) {
subBuilder = ((com.google.api.expr.v1alpha1.Decl.IdentDecl) declKind_).toBuilder();
}
declKind_ =
input.readMessage(com.google.api.expr.v1alpha1.Decl.IdentDecl.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((com.google.api.expr.v1alpha1.Decl.IdentDecl) declKind_);
declKind_ = subBuilder.buildPartial();
}
declKindCase_ = 2;
break;
}
case 26: {
com.google.api.expr.v1alpha1.Decl.FunctionDecl.Builder subBuilder = null;
if (declKindCase_ == 3) {
subBuilder = ((com.google.api.expr.v1alpha1.Decl.FunctionDecl) declKind_).toBuilder();
}
declKind_ =
input.readMessage(com.google.api.expr.v1alpha1.Decl.FunctionDecl.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((com.google.api.expr.v1alpha1.Decl.FunctionDecl) declKind_);
declKind_ = subBuilder.buildPartial();
}
declKindCase_ = 3;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.api.expr.v1alpha1.DeclProto.internal_static_google_api_expr_v1alpha1_Decl_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.api.expr.v1alpha1.DeclProto.internal_static_google_api_expr_v1alpha1_Decl_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.api.expr.v1alpha1.Decl.class, com.google.api.expr.v1alpha1.Decl.Builder.class);
}
public interface IdentDeclOrBuilder extends
// @@protoc_insertion_point(interface_extends:google.api.expr.v1alpha1.Decl.IdentDecl)
com.google.protobuf.MessageOrBuilder {
/**
*
* Required. The type of the identifier.
*
*
* .google.api.expr.v1alpha1.Type type = 1;
* @return Whether the type field is set.
*/
boolean hasType();
/**
*
* Required. The type of the identifier.
*
*
* .google.api.expr.v1alpha1.Type type = 1;
* @return The type.
*/
com.google.api.expr.v1alpha1.Type getType();
/**
*
*
* string doc = 3;
* @return The bytes for doc.
*/
com.google.protobuf.ByteString
getDocBytes();
}
/**
*
* Identifier declaration which specifies its type and optional `Expr` value.
* An identifier without a value is a declaration that must be provided at
* evaluation time. An identifier with a value should resolve to a constant,
* but may be used in conjunction with other identifiers bound at evaluation
* time.
*
*
* Protobuf type {@code google.api.expr.v1alpha1.Decl.IdentDecl}
*/
public static final class IdentDecl extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.api.expr.v1alpha1.Decl.IdentDecl)
IdentDeclOrBuilder {
private static final long serialVersionUID = 0L;
// Use IdentDecl.newBuilder() to construct.
private IdentDecl(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private IdentDecl() {
doc_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new IdentDecl();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private IdentDecl(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
com.google.api.expr.v1alpha1.Type.Builder subBuilder = null;
if (type_ != null) {
subBuilder = type_.toBuilder();
}
type_ = input.readMessage(com.google.api.expr.v1alpha1.Type.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(type_);
type_ = subBuilder.buildPartial();
}
break;
}
case 18: {
com.google.api.expr.v1alpha1.Constant.Builder subBuilder = null;
if (value_ != null) {
subBuilder = value_.toBuilder();
}
value_ = input.readMessage(com.google.api.expr.v1alpha1.Constant.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(value_);
value_ = subBuilder.buildPartial();
}
break;
}
case 26: {
java.lang.String s = input.readStringRequireUtf8();
doc_ = s;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.api.expr.v1alpha1.DeclProto.internal_static_google_api_expr_v1alpha1_Decl_IdentDecl_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.api.expr.v1alpha1.DeclProto.internal_static_google_api_expr_v1alpha1_Decl_IdentDecl_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.api.expr.v1alpha1.Decl.IdentDecl.class, com.google.api.expr.v1alpha1.Decl.IdentDecl.Builder.class);
}
public static final int TYPE_FIELD_NUMBER = 1;
private com.google.api.expr.v1alpha1.Type type_;
/**
*
* Required. The type of the identifier.
*
*
* .google.api.expr.v1alpha1.Type type = 1;
* @return Whether the type field is set.
*/
@java.lang.Override
public boolean hasType() {
return type_ != null;
}
/**
*
* Required. The type of the identifier.
*
*
* .google.api.expr.v1alpha1.Type type = 1;
* @return The type.
*/
@java.lang.Override
public com.google.api.expr.v1alpha1.Type getType() {
return type_ == null ? com.google.api.expr.v1alpha1.Type.getDefaultInstance() : type_;
}
/**
*
* Required. The type of the identifier.
*
*
* .google.api.expr.v1alpha1.Type type = 1;
*/
@java.lang.Override
public com.google.api.expr.v1alpha1.TypeOrBuilder getTypeOrBuilder() {
return getType();
}
public static final int VALUE_FIELD_NUMBER = 2;
private com.google.api.expr.v1alpha1.Constant value_;
/**
*
* The constant value of the identifier. If not specified, the identifier
* must be supplied at evaluation time.
*
*
* .google.api.expr.v1alpha1.Constant value = 2;
* @return Whether the value field is set.
*/
@java.lang.Override
public boolean hasValue() {
return value_ != null;
}
/**
*
* The constant value of the identifier. If not specified, the identifier
* must be supplied at evaluation time.
*
*
* .google.api.expr.v1alpha1.Constant value = 2;
* @return The value.
*/
@java.lang.Override
public com.google.api.expr.v1alpha1.Constant getValue() {
return value_ == null ? com.google.api.expr.v1alpha1.Constant.getDefaultInstance() : value_;
}
/**
*
* The constant value of the identifier. If not specified, the identifier
* must be supplied at evaluation time.
*
*
* .google.api.expr.v1alpha1.Constant value = 2;
*/
@java.lang.Override
public com.google.api.expr.v1alpha1.ConstantOrBuilder getValueOrBuilder() {
return getValue();
}
public static final int DOC_FIELD_NUMBER = 3;
private volatile java.lang.Object doc_;
/**
*
*
* string doc = 3;
* @return The bytes for doc.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getDocBytes() {
java.lang.Object ref = doc_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
doc_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
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 {
if (type_ != null) {
output.writeMessage(1, getType());
}
if (value_ != null) {
output.writeMessage(2, getValue());
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(doc_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, doc_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (type_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getType());
}
if (value_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getValue());
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(doc_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, doc_);
}
size += unknownFields.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.Decl.IdentDecl)) {
return super.equals(obj);
}
com.google.api.expr.v1alpha1.Decl.IdentDecl other = (com.google.api.expr.v1alpha1.Decl.IdentDecl) obj;
if (hasType() != other.hasType()) return false;
if (hasType()) {
if (!getType()
.equals(other.getType())) return false;
}
if (hasValue() != other.hasValue()) return false;
if (hasValue()) {
if (!getValue()
.equals(other.getValue())) return false;
}
if (!getDoc()
.equals(other.getDoc())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasType()) {
hash = (37 * hash) + TYPE_FIELD_NUMBER;
hash = (53 * hash) + getType().hashCode();
}
if (hasValue()) {
hash = (37 * hash) + VALUE_FIELD_NUMBER;
hash = (53 * hash) + getValue().hashCode();
}
hash = (37 * hash) + DOC_FIELD_NUMBER;
hash = (53 * hash) + getDoc().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.api.expr.v1alpha1.Decl.IdentDecl parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.expr.v1alpha1.Decl.IdentDecl 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.Decl.IdentDecl parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.expr.v1alpha1.Decl.IdentDecl 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.Decl.IdentDecl parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.expr.v1alpha1.Decl.IdentDecl 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.Decl.IdentDecl parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.api.expr.v1alpha1.Decl.IdentDecl 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.Decl.IdentDecl parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.api.expr.v1alpha1.Decl.IdentDecl 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.Decl.IdentDecl 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.Decl.IdentDecl 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.Decl.IdentDecl 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;
}
/**
*
* Identifier declaration which specifies its type and optional `Expr` value.
* An identifier without a value is a declaration that must be provided at
* evaluation time. An identifier with a value should resolve to a constant,
* but may be used in conjunction with other identifiers bound at evaluation
* time.
*
*
* Protobuf type {@code google.api.expr.v1alpha1.Decl.IdentDecl}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:google.api.expr.v1alpha1.Decl.IdentDecl)
com.google.api.expr.v1alpha1.Decl.IdentDeclOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.api.expr.v1alpha1.DeclProto.internal_static_google_api_expr_v1alpha1_Decl_IdentDecl_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.api.expr.v1alpha1.DeclProto.internal_static_google_api_expr_v1alpha1_Decl_IdentDecl_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.api.expr.v1alpha1.Decl.IdentDecl.class, com.google.api.expr.v1alpha1.Decl.IdentDecl.Builder.class);
}
// Construct using com.google.api.expr.v1alpha1.Decl.IdentDecl.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
if (typeBuilder_ == null) {
type_ = null;
} else {
type_ = null;
typeBuilder_ = null;
}
if (valueBuilder_ == null) {
value_ = null;
} else {
value_ = null;
valueBuilder_ = null;
}
doc_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.api.expr.v1alpha1.DeclProto.internal_static_google_api_expr_v1alpha1_Decl_IdentDecl_descriptor;
}
@java.lang.Override
public com.google.api.expr.v1alpha1.Decl.IdentDecl getDefaultInstanceForType() {
return com.google.api.expr.v1alpha1.Decl.IdentDecl.getDefaultInstance();
}
@java.lang.Override
public com.google.api.expr.v1alpha1.Decl.IdentDecl build() {
com.google.api.expr.v1alpha1.Decl.IdentDecl result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.api.expr.v1alpha1.Decl.IdentDecl buildPartial() {
com.google.api.expr.v1alpha1.Decl.IdentDecl result = new com.google.api.expr.v1alpha1.Decl.IdentDecl(this);
if (typeBuilder_ == null) {
result.type_ = type_;
} else {
result.type_ = typeBuilder_.build();
}
if (valueBuilder_ == null) {
result.value_ = value_;
} else {
result.value_ = valueBuilder_.build();
}
result.doc_ = doc_;
onBuilt();
return result;
}
@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.Decl.IdentDecl) {
return mergeFrom((com.google.api.expr.v1alpha1.Decl.IdentDecl)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.api.expr.v1alpha1.Decl.IdentDecl other) {
if (other == com.google.api.expr.v1alpha1.Decl.IdentDecl.getDefaultInstance()) return this;
if (other.hasType()) {
mergeType(other.getType());
}
if (other.hasValue()) {
mergeValue(other.getValue());
}
if (!other.getDoc().isEmpty()) {
doc_ = other.doc_;
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
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 {
com.google.api.expr.v1alpha1.Decl.IdentDecl parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.api.expr.v1alpha1.Decl.IdentDecl) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private com.google.api.expr.v1alpha1.Type type_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.api.expr.v1alpha1.Type, com.google.api.expr.v1alpha1.Type.Builder, com.google.api.expr.v1alpha1.TypeOrBuilder> typeBuilder_;
/**
*
* Required. The type of the identifier.
*
*
* .google.api.expr.v1alpha1.Type type = 1;
* @return Whether the type field is set.
*/
public boolean hasType() {
return typeBuilder_ != null || type_ != null;
}
/**
*
* Required. The type of the identifier.
*
*
* .google.api.expr.v1alpha1.Type type = 1;
* @return The type.
*/
public com.google.api.expr.v1alpha1.Type getType() {
if (typeBuilder_ == null) {
return type_ == null ? com.google.api.expr.v1alpha1.Type.getDefaultInstance() : type_;
} else {
return typeBuilder_.getMessage();
}
}
/**
*
* Required. The type of the identifier.
*
*
* .google.api.expr.v1alpha1.Type type = 1;
*/
public Builder setType(com.google.api.expr.v1alpha1.Type value) {
if (typeBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
type_ = value;
onChanged();
} else {
typeBuilder_.setMessage(value);
}
return this;
}
/**
*
* The constant value of the identifier. If not specified, the identifier
* must be supplied at evaluation time.
*
*
* .google.api.expr.v1alpha1.Constant value = 2;
* @return Whether the value field is set.
*/
public boolean hasValue() {
return valueBuilder_ != null || value_ != null;
}
/**
*
* The constant value of the identifier. If not specified, the identifier
* must be supplied at evaluation time.
*
*
* .google.api.expr.v1alpha1.Constant value = 2;
* @return The value.
*/
public com.google.api.expr.v1alpha1.Constant getValue() {
if (valueBuilder_ == null) {
return value_ == null ? com.google.api.expr.v1alpha1.Constant.getDefaultInstance() : value_;
} else {
return valueBuilder_.getMessage();
}
}
/**
*
* The constant value of the identifier. If not specified, the identifier
* must be supplied at evaluation time.
*
*
* .google.api.expr.v1alpha1.Constant value = 2;
*/
public Builder setValue(com.google.api.expr.v1alpha1.Constant value) {
if (valueBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
value_ = value;
onChanged();
} else {
valueBuilder_.setMessage(value);
}
return this;
}
/**
*
* The constant value of the identifier. If not specified, the identifier
* must be supplied at evaluation time.
*
* Function declaration specifies one or more overloads which indicate the
* function's parameter types and return type.
* Functions have no observable side-effects (there may be side-effects like
* logging which are not observable from CEL).
*
*
* Protobuf type {@code google.api.expr.v1alpha1.Decl.FunctionDecl}
*/
public static final class FunctionDecl extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.api.expr.v1alpha1.Decl.FunctionDecl)
FunctionDeclOrBuilder {
private static final long serialVersionUID = 0L;
// Use FunctionDecl.newBuilder() to construct.
private FunctionDecl(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private FunctionDecl() {
overloads_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new FunctionDecl();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private FunctionDecl(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
overloads_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000001;
}
overloads_.add(
input.readMessage(com.google.api.expr.v1alpha1.Decl.FunctionDecl.Overload.parser(), extensionRegistry));
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
overloads_ = java.util.Collections.unmodifiableList(overloads_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.api.expr.v1alpha1.DeclProto.internal_static_google_api_expr_v1alpha1_Decl_FunctionDecl_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.api.expr.v1alpha1.DeclProto.internal_static_google_api_expr_v1alpha1_Decl_FunctionDecl_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.api.expr.v1alpha1.Decl.FunctionDecl.class, com.google.api.expr.v1alpha1.Decl.FunctionDecl.Builder.class);
}
public interface OverloadOrBuilder extends
// @@protoc_insertion_point(interface_extends:google.api.expr.v1alpha1.Decl.FunctionDecl.Overload)
com.google.protobuf.MessageOrBuilder {
/**
*
* Required. Globally unique overload name of the function which reflects
* the function name and argument types.
* This will be used by a [Reference][google.api.expr.v1alpha1.Reference]
* to indicate the `overload_id` that was resolved for the function
* `name`.
*
* Required. Globally unique overload name of the function which reflects
* the function name and argument types.
* This will be used by a [Reference][google.api.expr.v1alpha1.Reference]
* to indicate the `overload_id` that was resolved for the function
* `name`.
*
*
* string overload_id = 1;
* @return The bytes for overloadId.
*/
com.google.protobuf.ByteString
getOverloadIdBytes();
/**
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
* The type param names associated with the function declaration.
* For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
* the type params of `K, V`.
*
*
* repeated string type_params = 3;
* @return A list containing the typeParams.
*/
java.util.List
getTypeParamsList();
/**
*
* The type param names associated with the function declaration.
* For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
* the type params of `K, V`.
*
*
* repeated string type_params = 3;
* @return The count of typeParams.
*/
int getTypeParamsCount();
/**
*
* The type param names associated with the function declaration.
* For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
* the type params of `K, V`.
*
*
* repeated string type_params = 3;
* @param index The index of the element to return.
* @return The typeParams at the given index.
*/
java.lang.String getTypeParams(int index);
/**
*
* The type param names associated with the function declaration.
* For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
* the type params of `K, V`.
*
*
* repeated string type_params = 3;
* @param index The index of the value to return.
* @return The bytes of the typeParams at the given index.
*/
com.google.protobuf.ByteString
getTypeParamsBytes(int index);
/**
*
* Required. The result type of the function. For example, the operator
* `string.isEmpty()` would have `result_type` of `kind: BOOL`.
*
*
* .google.api.expr.v1alpha1.Type result_type = 4;
* @return Whether the resultType field is set.
*/
boolean hasResultType();
/**
*
* Required. The result type of the function. For example, the operator
* `string.isEmpty()` would have `result_type` of `kind: BOOL`.
*
* Whether the function is to be used in a method call-style `x.f(...)`
* or a function call-style `f(x, ...)`.
* For methods, the first parameter declaration, `params[0]` is the
* expected type of the target receiver.
*
*
* string doc = 6;
* @return The bytes for doc.
*/
com.google.protobuf.ByteString
getDocBytes();
}
/**
*
* An overload indicates a function's parameter types and return type, and
* may optionally include a function body described in terms of
* [Expr][google.api.expr.v1alpha1.Expr] values.
* Functions overloads are declared in either a function or method
* call-style. For methods, the `params[0]` is the expected type of the
* target receiver.
* Overloads must have non-overlapping argument types after erasure of all
* parameterized type variables (similar as type erasure in Java).
*
*
* Protobuf type {@code google.api.expr.v1alpha1.Decl.FunctionDecl.Overload}
*/
public static final class Overload extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.api.expr.v1alpha1.Decl.FunctionDecl.Overload)
OverloadOrBuilder {
private static final long serialVersionUID = 0L;
// Use Overload.newBuilder() to construct.
private Overload(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Overload() {
overloadId_ = "";
params_ = java.util.Collections.emptyList();
typeParams_ = com.google.protobuf.LazyStringArrayList.EMPTY;
doc_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new Overload();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Overload(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
java.lang.String s = input.readStringRequireUtf8();
overloadId_ = s;
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
params_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000001;
}
params_.add(
input.readMessage(com.google.api.expr.v1alpha1.Type.parser(), extensionRegistry));
break;
}
case 26: {
java.lang.String s = input.readStringRequireUtf8();
if (!((mutable_bitField0_ & 0x00000002) != 0)) {
typeParams_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000002;
}
typeParams_.add(s);
break;
}
case 34: {
com.google.api.expr.v1alpha1.Type.Builder subBuilder = null;
if (resultType_ != null) {
subBuilder = resultType_.toBuilder();
}
resultType_ = input.readMessage(com.google.api.expr.v1alpha1.Type.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(resultType_);
resultType_ = subBuilder.buildPartial();
}
break;
}
case 40: {
isInstanceFunction_ = input.readBool();
break;
}
case 50: {
java.lang.String s = input.readStringRequireUtf8();
doc_ = s;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
params_ = java.util.Collections.unmodifiableList(params_);
}
if (((mutable_bitField0_ & 0x00000002) != 0)) {
typeParams_ = typeParams_.getUnmodifiableView();
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.api.expr.v1alpha1.DeclProto.internal_static_google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.api.expr.v1alpha1.DeclProto.internal_static_google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.api.expr.v1alpha1.Decl.FunctionDecl.Overload.class, com.google.api.expr.v1alpha1.Decl.FunctionDecl.Overload.Builder.class);
}
public static final int OVERLOAD_ID_FIELD_NUMBER = 1;
private volatile java.lang.Object overloadId_;
/**
*
* Required. Globally unique overload name of the function which reflects
* the function name and argument types.
* This will be used by a [Reference][google.api.expr.v1alpha1.Reference]
* to indicate the `overload_id` that was resolved for the function
* `name`.
*
* Required. Globally unique overload name of the function which reflects
* the function name and argument types.
* This will be used by a [Reference][google.api.expr.v1alpha1.Reference]
* to indicate the `overload_id` that was resolved for the function
* `name`.
*
*
* string overload_id = 1;
* @return The bytes for overloadId.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getOverloadIdBytes() {
java.lang.Object ref = overloadId_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
overloadId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int PARAMS_FIELD_NUMBER = 2;
private java.util.List params_;
/**
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
*
* repeated .google.api.expr.v1alpha1.Type params = 2;
*/
@java.lang.Override
public int getParamsCount() {
return params_.size();
}
/**
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
*
* repeated .google.api.expr.v1alpha1.Type params = 2;
*/
@java.lang.Override
public com.google.api.expr.v1alpha1.TypeOrBuilder getParamsOrBuilder(
int index) {
return params_.get(index);
}
public static final int TYPE_PARAMS_FIELD_NUMBER = 3;
private com.google.protobuf.LazyStringList typeParams_;
/**
*
* The type param names associated with the function declaration.
* For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
* the type params of `K, V`.
*
*
* repeated string type_params = 3;
* @return A list containing the typeParams.
*/
public com.google.protobuf.ProtocolStringList
getTypeParamsList() {
return typeParams_;
}
/**
*
* The type param names associated with the function declaration.
* For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
* the type params of `K, V`.
*
*
* repeated string type_params = 3;
* @return The count of typeParams.
*/
public int getTypeParamsCount() {
return typeParams_.size();
}
/**
*
* The type param names associated with the function declaration.
* For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
* the type params of `K, V`.
*
*
* repeated string type_params = 3;
* @param index The index of the element to return.
* @return The typeParams at the given index.
*/
public java.lang.String getTypeParams(int index) {
return typeParams_.get(index);
}
/**
*
* The type param names associated with the function declaration.
* For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
* the type params of `K, V`.
*
*
* repeated string type_params = 3;
* @param index The index of the value to return.
* @return The bytes of the typeParams at the given index.
*/
public com.google.protobuf.ByteString
getTypeParamsBytes(int index) {
return typeParams_.getByteString(index);
}
public static final int RESULT_TYPE_FIELD_NUMBER = 4;
private com.google.api.expr.v1alpha1.Type resultType_;
/**
*
* Required. The result type of the function. For example, the operator
* `string.isEmpty()` would have `result_type` of `kind: BOOL`.
*
*
* .google.api.expr.v1alpha1.Type result_type = 4;
* @return Whether the resultType field is set.
*/
@java.lang.Override
public boolean hasResultType() {
return resultType_ != null;
}
/**
*
* Required. The result type of the function. For example, the operator
* `string.isEmpty()` would have `result_type` of `kind: BOOL`.
*
* Required. The result type of the function. For example, the operator
* `string.isEmpty()` would have `result_type` of `kind: BOOL`.
*
*
* .google.api.expr.v1alpha1.Type result_type = 4;
*/
@java.lang.Override
public com.google.api.expr.v1alpha1.TypeOrBuilder getResultTypeOrBuilder() {
return getResultType();
}
public static final int IS_INSTANCE_FUNCTION_FIELD_NUMBER = 5;
private boolean isInstanceFunction_;
/**
*
* Whether the function is to be used in a method call-style `x.f(...)`
* or a function call-style `f(x, ...)`.
* For methods, the first parameter declaration, `params[0]` is the
* expected type of the target receiver.
*
*
* bool is_instance_function = 5;
* @return The isInstanceFunction.
*/
@java.lang.Override
public boolean getIsInstanceFunction() {
return isInstanceFunction_;
}
public static final int DOC_FIELD_NUMBER = 6;
private volatile java.lang.Object doc_;
/**
*
*
* string doc = 6;
* @return The bytes for doc.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getDocBytes() {
java.lang.Object ref = doc_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
doc_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
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 {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(overloadId_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, overloadId_);
}
for (int i = 0; i < params_.size(); i++) {
output.writeMessage(2, params_.get(i));
}
for (int i = 0; i < typeParams_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, typeParams_.getRaw(i));
}
if (resultType_ != null) {
output.writeMessage(4, getResultType());
}
if (isInstanceFunction_ != false) {
output.writeBool(5, isInstanceFunction_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(doc_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 6, doc_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(overloadId_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, overloadId_);
}
for (int i = 0; i < params_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, params_.get(i));
}
{
int dataSize = 0;
for (int i = 0; i < typeParams_.size(); i++) {
dataSize += computeStringSizeNoTag(typeParams_.getRaw(i));
}
size += dataSize;
size += 1 * getTypeParamsList().size();
}
if (resultType_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, getResultType());
}
if (isInstanceFunction_ != false) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(5, isInstanceFunction_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(doc_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, doc_);
}
size += unknownFields.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.Decl.FunctionDecl.Overload)) {
return super.equals(obj);
}
com.google.api.expr.v1alpha1.Decl.FunctionDecl.Overload other = (com.google.api.expr.v1alpha1.Decl.FunctionDecl.Overload) obj;
if (!getOverloadId()
.equals(other.getOverloadId())) return false;
if (!getParamsList()
.equals(other.getParamsList())) return false;
if (!getTypeParamsList()
.equals(other.getTypeParamsList())) return false;
if (hasResultType() != other.hasResultType()) return false;
if (hasResultType()) {
if (!getResultType()
.equals(other.getResultType())) return false;
}
if (getIsInstanceFunction()
!= other.getIsInstanceFunction()) return false;
if (!getDoc()
.equals(other.getDoc())) return false;
if (!unknownFields.equals(other.unknownFields)) 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) + OVERLOAD_ID_FIELD_NUMBER;
hash = (53 * hash) + getOverloadId().hashCode();
if (getParamsCount() > 0) {
hash = (37 * hash) + PARAMS_FIELD_NUMBER;
hash = (53 * hash) + getParamsList().hashCode();
}
if (getTypeParamsCount() > 0) {
hash = (37 * hash) + TYPE_PARAMS_FIELD_NUMBER;
hash = (53 * hash) + getTypeParamsList().hashCode();
}
if (hasResultType()) {
hash = (37 * hash) + RESULT_TYPE_FIELD_NUMBER;
hash = (53 * hash) + getResultType().hashCode();
}
hash = (37 * hash) + IS_INSTANCE_FUNCTION_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getIsInstanceFunction());
hash = (37 * hash) + DOC_FIELD_NUMBER;
hash = (53 * hash) + getDoc().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.api.expr.v1alpha1.Decl.FunctionDecl.Overload parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.expr.v1alpha1.Decl.FunctionDecl.Overload 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.Decl.FunctionDecl.Overload parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.expr.v1alpha1.Decl.FunctionDecl.Overload 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.Decl.FunctionDecl.Overload parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.expr.v1alpha1.Decl.FunctionDecl.Overload 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.Decl.FunctionDecl.Overload parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.api.expr.v1alpha1.Decl.FunctionDecl.Overload 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.Decl.FunctionDecl.Overload parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.api.expr.v1alpha1.Decl.FunctionDecl.Overload 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.Decl.FunctionDecl.Overload 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.Decl.FunctionDecl.Overload 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.Decl.FunctionDecl.Overload 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;
}
/**
*
* An overload indicates a function's parameter types and return type, and
* may optionally include a function body described in terms of
* [Expr][google.api.expr.v1alpha1.Expr] values.
* Functions overloads are declared in either a function or method
* call-style. For methods, the `params[0]` is the expected type of the
* target receiver.
* Overloads must have non-overlapping argument types after erasure of all
* parameterized type variables (similar as type erasure in Java).
*
* Required. Globally unique overload name of the function which reflects
* the function name and argument types.
* This will be used by a [Reference][google.api.expr.v1alpha1.Reference]
* to indicate the `overload_id` that was resolved for the function
* `name`.
*
* Required. Globally unique overload name of the function which reflects
* the function name and argument types.
* This will be used by a [Reference][google.api.expr.v1alpha1.Reference]
* to indicate the `overload_id` that was resolved for the function
* `name`.
*
*
* string overload_id = 1;
* @return The bytes for overloadId.
*/
public com.google.protobuf.ByteString
getOverloadIdBytes() {
java.lang.Object ref = overloadId_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
overloadId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Required. Globally unique overload name of the function which reflects
* the function name and argument types.
* This will be used by a [Reference][google.api.expr.v1alpha1.Reference]
* to indicate the `overload_id` that was resolved for the function
* `name`.
*
*
* string overload_id = 1;
* @param value The overloadId to set.
* @return This builder for chaining.
*/
public Builder setOverloadId(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
overloadId_ = value;
onChanged();
return this;
}
/**
*
* Required. Globally unique overload name of the function which reflects
* the function name and argument types.
* This will be used by a [Reference][google.api.expr.v1alpha1.Reference]
* to indicate the `overload_id` that was resolved for the function
* `name`.
*
*
* string overload_id = 1;
* @return This builder for chaining.
*/
public Builder clearOverloadId() {
overloadId_ = getDefaultInstance().getOverloadId();
onChanged();
return this;
}
/**
*
* Required. Globally unique overload name of the function which reflects
* the function name and argument types.
* This will be used by a [Reference][google.api.expr.v1alpha1.Reference]
* to indicate the `overload_id` that was resolved for the function
* `name`.
*
*
* string overload_id = 1;
* @param value The bytes for overloadId to set.
* @return This builder for chaining.
*/
public Builder setOverloadIdBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
overloadId_ = value;
onChanged();
return this;
}
private java.util.List params_ =
java.util.Collections.emptyList();
private void ensureParamsIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
params_ = new java.util.ArrayList(params_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.api.expr.v1alpha1.Type, com.google.api.expr.v1alpha1.Type.Builder, com.google.api.expr.v1alpha1.TypeOrBuilder> paramsBuilder_;
/**
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
*
* repeated .google.api.expr.v1alpha1.Type params = 2;
*/
public int getParamsCount() {
if (paramsBuilder_ == null) {
return params_.size();
} else {
return paramsBuilder_.getCount();
}
}
/**
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
*
* repeated .google.api.expr.v1alpha1.Type params = 2;
*/
public Builder setParams(
int index, com.google.api.expr.v1alpha1.Type value) {
if (paramsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureParamsIsMutable();
params_.set(index, value);
onChanged();
} else {
paramsBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
*
* repeated .google.api.expr.v1alpha1.Type params = 2;
*/
public Builder addParams(com.google.api.expr.v1alpha1.Type value) {
if (paramsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureParamsIsMutable();
params_.add(value);
onChanged();
} else {
paramsBuilder_.addMessage(value);
}
return this;
}
/**
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
*
* repeated .google.api.expr.v1alpha1.Type params = 2;
*/
public Builder addParams(
int index, com.google.api.expr.v1alpha1.Type value) {
if (paramsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureParamsIsMutable();
params_.add(index, value);
onChanged();
} else {
paramsBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
*
* repeated .google.api.expr.v1alpha1.Type params = 2;
*/
public com.google.api.expr.v1alpha1.Type.Builder getParamsBuilder(
int index) {
return getParamsFieldBuilder().getBuilder(index);
}
/**
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
*
* repeated .google.api.expr.v1alpha1.Type params = 2;
*/
public com.google.api.expr.v1alpha1.TypeOrBuilder getParamsOrBuilder(
int index) {
if (paramsBuilder_ == null) {
return params_.get(index); } else {
return paramsBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
* List of function parameter [Type][google.api.expr.v1alpha1.Type]
* values.
* Param types are disjoint after generic type parameters have been
* replaced with the type `DYN`. Since the `DYN` type is compatible with
* any other type, this means that if `A` is a type parameter, the
* function types `int<A>` and `int<int>` are not disjoint. Likewise,
* `map<string, string>` is not disjoint from `map<K, V>`.
* When the `result_type` of a function is a generic type param, the
* type param name also appears as the `type` of on at least one params.
*
* The type param names associated with the function declaration.
* For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
* the type params of `K, V`.
*
*
* repeated string type_params = 3;
* @return A list containing the typeParams.
*/
public com.google.protobuf.ProtocolStringList
getTypeParamsList() {
return typeParams_.getUnmodifiableView();
}
/**
*
* The type param names associated with the function declaration.
* For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
* the type params of `K, V`.
*
*
* repeated string type_params = 3;
* @return The count of typeParams.
*/
public int getTypeParamsCount() {
return typeParams_.size();
}
/**
*
* The type param names associated with the function declaration.
* For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
* the type params of `K, V`.
*
*
* repeated string type_params = 3;
* @param index The index of the element to return.
* @return The typeParams at the given index.
*/
public java.lang.String getTypeParams(int index) {
return typeParams_.get(index);
}
/**
*
* The type param names associated with the function declaration.
* For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
* the type params of `K, V`.
*
*
* repeated string type_params = 3;
* @param index The index of the value to return.
* @return The bytes of the typeParams at the given index.
*/
public com.google.protobuf.ByteString
getTypeParamsBytes(int index) {
return typeParams_.getByteString(index);
}
/**
*
* The type param names associated with the function declaration.
* For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
* the type params of `K, V`.
*
*
* repeated string type_params = 3;
* @param index The index to set the value at.
* @param value The typeParams to set.
* @return This builder for chaining.
*/
public Builder setTypeParams(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureTypeParamsIsMutable();
typeParams_.set(index, value);
onChanged();
return this;
}
/**
*
* The type param names associated with the function declaration.
* For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
* the type params of `K, V`.
*
*
* repeated string type_params = 3;
* @param value The typeParams to add.
* @return This builder for chaining.
*/
public Builder addTypeParams(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureTypeParamsIsMutable();
typeParams_.add(value);
onChanged();
return this;
}
/**
*
* The type param names associated with the function declaration.
* For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
* the type params of `K, V`.
*
*
* repeated string type_params = 3;
* @param values The typeParams to add.
* @return This builder for chaining.
*/
public Builder addAllTypeParams(
java.lang.Iterable values) {
ensureTypeParamsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, typeParams_);
onChanged();
return this;
}
/**
*
* The type param names associated with the function declaration.
* For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
* the type params of `K, V`.
*
* The type param names associated with the function declaration.
* For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
* the type params of `K, V`.
*
*
* repeated string type_params = 3;
* @param value The bytes of the typeParams to add.
* @return This builder for chaining.
*/
public Builder addTypeParamsBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureTypeParamsIsMutable();
typeParams_.add(value);
onChanged();
return this;
}
private com.google.api.expr.v1alpha1.Type resultType_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.api.expr.v1alpha1.Type, com.google.api.expr.v1alpha1.Type.Builder, com.google.api.expr.v1alpha1.TypeOrBuilder> resultTypeBuilder_;
/**
*
* Required. The result type of the function. For example, the operator
* `string.isEmpty()` would have `result_type` of `kind: BOOL`.
*
*
* .google.api.expr.v1alpha1.Type result_type = 4;
* @return Whether the resultType field is set.
*/
public boolean hasResultType() {
return resultTypeBuilder_ != null || resultType_ != null;
}
/**
*
* Required. The result type of the function. For example, the operator
* `string.isEmpty()` would have `result_type` of `kind: BOOL`.
*
* Whether the function is to be used in a method call-style `x.f(...)`
* or a function call-style `f(x, ...)`.
* For methods, the first parameter declaration, `params[0]` is the
* expected type of the target receiver.
*
* Whether the function is to be used in a method call-style `x.f(...)`
* or a function call-style `f(x, ...)`.
* For methods, the first parameter declaration, `params[0]` is the
* expected type of the target receiver.
*
*
* bool is_instance_function = 5;
* @param value The isInstanceFunction to set.
* @return This builder for chaining.
*/
public Builder setIsInstanceFunction(boolean value) {
isInstanceFunction_ = value;
onChanged();
return this;
}
/**
*
* Whether the function is to be used in a method call-style `x.f(...)`
* or a function call-style `f(x, ...)`.
* For methods, the first parameter declaration, `params[0]` is the
* expected type of the target receiver.
*
* Required. List of function overloads, must contain at least one overload.
*
*
* repeated .google.api.expr.v1alpha1.Decl.FunctionDecl.Overload overloads = 1;
*/
@java.lang.Override
public com.google.api.expr.v1alpha1.Decl.FunctionDecl.OverloadOrBuilder getOverloadsOrBuilder(
int index) {
return overloads_.get(index);
}
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 {
for (int i = 0; i < overloads_.size(); i++) {
output.writeMessage(1, overloads_.get(i));
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < overloads_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, overloads_.get(i));
}
size += unknownFields.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.Decl.FunctionDecl)) {
return super.equals(obj);
}
com.google.api.expr.v1alpha1.Decl.FunctionDecl other = (com.google.api.expr.v1alpha1.Decl.FunctionDecl) obj;
if (!getOverloadsList()
.equals(other.getOverloadsList())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getOverloadsCount() > 0) {
hash = (37 * hash) + OVERLOADS_FIELD_NUMBER;
hash = (53 * hash) + getOverloadsList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.api.expr.v1alpha1.Decl.FunctionDecl parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.expr.v1alpha1.Decl.FunctionDecl 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.Decl.FunctionDecl parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.expr.v1alpha1.Decl.FunctionDecl 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.Decl.FunctionDecl parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.expr.v1alpha1.Decl.FunctionDecl 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.Decl.FunctionDecl parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.api.expr.v1alpha1.Decl.FunctionDecl 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.Decl.FunctionDecl parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.api.expr.v1alpha1.Decl.FunctionDecl 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.Decl.FunctionDecl 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.Decl.FunctionDecl 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.Decl.FunctionDecl 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;
}
/**
*
* Function declaration specifies one or more overloads which indicate the
* function's parameter types and return type.
* Functions have no observable side-effects (there may be side-effects like
* logging which are not observable from CEL).
*
*
* Protobuf type {@code google.api.expr.v1alpha1.Decl.FunctionDecl}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:google.api.expr.v1alpha1.Decl.FunctionDecl)
com.google.api.expr.v1alpha1.Decl.FunctionDeclOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.api.expr.v1alpha1.DeclProto.internal_static_google_api_expr_v1alpha1_Decl_FunctionDecl_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.api.expr.v1alpha1.DeclProto.internal_static_google_api_expr_v1alpha1_Decl_FunctionDecl_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.api.expr.v1alpha1.Decl.FunctionDecl.class, com.google.api.expr.v1alpha1.Decl.FunctionDecl.Builder.class);
}
// Construct using com.google.api.expr.v1alpha1.Decl.FunctionDecl.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getOverloadsFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
if (overloadsBuilder_ == null) {
overloads_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
overloadsBuilder_.clear();
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.api.expr.v1alpha1.DeclProto.internal_static_google_api_expr_v1alpha1_Decl_FunctionDecl_descriptor;
}
@java.lang.Override
public com.google.api.expr.v1alpha1.Decl.FunctionDecl getDefaultInstanceForType() {
return com.google.api.expr.v1alpha1.Decl.FunctionDecl.getDefaultInstance();
}
@java.lang.Override
public com.google.api.expr.v1alpha1.Decl.FunctionDecl build() {
com.google.api.expr.v1alpha1.Decl.FunctionDecl result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.api.expr.v1alpha1.Decl.FunctionDecl buildPartial() {
com.google.api.expr.v1alpha1.Decl.FunctionDecl result = new com.google.api.expr.v1alpha1.Decl.FunctionDecl(this);
int from_bitField0_ = bitField0_;
if (overloadsBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
overloads_ = java.util.Collections.unmodifiableList(overloads_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.overloads_ = overloads_;
} else {
result.overloads_ = overloadsBuilder_.build();
}
onBuilt();
return result;
}
@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.Decl.FunctionDecl) {
return mergeFrom((com.google.api.expr.v1alpha1.Decl.FunctionDecl)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.api.expr.v1alpha1.Decl.FunctionDecl other) {
if (other == com.google.api.expr.v1alpha1.Decl.FunctionDecl.getDefaultInstance()) return this;
if (overloadsBuilder_ == null) {
if (!other.overloads_.isEmpty()) {
if (overloads_.isEmpty()) {
overloads_ = other.overloads_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureOverloadsIsMutable();
overloads_.addAll(other.overloads_);
}
onChanged();
}
} else {
if (!other.overloads_.isEmpty()) {
if (overloadsBuilder_.isEmpty()) {
overloadsBuilder_.dispose();
overloadsBuilder_ = null;
overloads_ = other.overloads_;
bitField0_ = (bitField0_ & ~0x00000001);
overloadsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getOverloadsFieldBuilder() : null;
} else {
overloadsBuilder_.addAllMessages(other.overloads_);
}
}
}
this.mergeUnknownFields(other.unknownFields);
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 {
com.google.api.expr.v1alpha1.Decl.FunctionDecl parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.api.expr.v1alpha1.Decl.FunctionDecl) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.util.List overloads_ =
java.util.Collections.emptyList();
private void ensureOverloadsIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
overloads_ = new java.util.ArrayList(overloads_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.api.expr.v1alpha1.Decl.FunctionDecl.Overload, com.google.api.expr.v1alpha1.Decl.FunctionDecl.Overload.Builder, com.google.api.expr.v1alpha1.Decl.FunctionDecl.OverloadOrBuilder> overloadsBuilder_;
/**
*
* Required. List of function overloads, must contain at least one overload.
*
* Required. List of function overloads, must contain at least one overload.
*
*
* repeated .google.api.expr.v1alpha1.Decl.FunctionDecl.Overload overloads = 1;
*/
public java.util.List
getOverloadsBuilderList() {
return getOverloadsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.api.expr.v1alpha1.Decl.FunctionDecl.Overload, com.google.api.expr.v1alpha1.Decl.FunctionDecl.Overload.Builder, com.google.api.expr.v1alpha1.Decl.FunctionDecl.OverloadOrBuilder>
getOverloadsFieldBuilder() {
if (overloadsBuilder_ == null) {
overloadsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.api.expr.v1alpha1.Decl.FunctionDecl.Overload, com.google.api.expr.v1alpha1.Decl.FunctionDecl.Overload.Builder, com.google.api.expr.v1alpha1.Decl.FunctionDecl.OverloadOrBuilder>(
overloads_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
overloads_ = null;
}
return overloadsBuilder_;
}
@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.Decl.FunctionDecl)
}
// @@protoc_insertion_point(class_scope:google.api.expr.v1alpha1.Decl.FunctionDecl)
private static final com.google.api.expr.v1alpha1.Decl.FunctionDecl DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.api.expr.v1alpha1.Decl.FunctionDecl();
}
public static com.google.api.expr.v1alpha1.Decl.FunctionDecl getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public FunctionDecl parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new FunctionDecl(input, extensionRegistry);
}
};
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.Decl.FunctionDecl getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private int declKindCase_ = 0;
private java.lang.Object declKind_;
public enum DeclKindCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
IDENT(2),
FUNCTION(3),
DECLKIND_NOT_SET(0);
private final int value;
private DeclKindCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static DeclKindCase valueOf(int value) {
return forNumber(value);
}
public static DeclKindCase forNumber(int value) {
switch (value) {
case 2: return IDENT;
case 3: return FUNCTION;
case 0: return DECLKIND_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public DeclKindCase
getDeclKindCase() {
return DeclKindCase.forNumber(
declKindCase_);
}
public static final int NAME_FIELD_NUMBER = 1;
private volatile java.lang.Object name_;
/**
*
* The fully qualified name of the declaration.
* Declarations are organized in containers and this represents the full path
* to the declaration in its container, as in `google.api.expr.Decl`.
* Declarations used as
* [FunctionDecl.Overload][google.api.expr.v1alpha1.Decl.FunctionDecl.Overload]
* parameters may or may not have a name depending on whether the overload is
* function declaration or a function definition containing a result
* [Expr][google.api.expr.v1alpha1.Expr].
*
*
* string name = 1;
* @return The name.
*/
@java.lang.Override
public java.lang.String getName() {
java.lang.Object ref = name_;
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();
name_ = s;
return s;
}
}
/**
*
* The fully qualified name of the declaration.
* Declarations are organized in containers and this represents the full path
* to the declaration in its container, as in `google.api.expr.Decl`.
* Declarations used as
* [FunctionDecl.Overload][google.api.expr.v1alpha1.Decl.FunctionDecl.Overload]
* parameters may or may not have a name depending on whether the overload is
* function declaration or a function definition containing a result
* [Expr][google.api.expr.v1alpha1.Expr].
*
*
* string name = 1;
* @return The bytes for name.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int IDENT_FIELD_NUMBER = 2;
/**
*
* Identifier declaration.
*
*
* .google.api.expr.v1alpha1.Decl.IdentDecl ident = 2;
* @return Whether the ident field is set.
*/
@java.lang.Override
public boolean hasIdent() {
return declKindCase_ == 2;
}
/**
*
* Identifier declaration.
*
*
* .google.api.expr.v1alpha1.Decl.IdentDecl ident = 2;
* @return The ident.
*/
@java.lang.Override
public com.google.api.expr.v1alpha1.Decl.IdentDecl getIdent() {
if (declKindCase_ == 2) {
return (com.google.api.expr.v1alpha1.Decl.IdentDecl) declKind_;
}
return com.google.api.expr.v1alpha1.Decl.IdentDecl.getDefaultInstance();
}
/**
*
* Identifier declaration.
*
*
* .google.api.expr.v1alpha1.Decl.IdentDecl ident = 2;
*/
@java.lang.Override
public com.google.api.expr.v1alpha1.Decl.IdentDeclOrBuilder getIdentOrBuilder() {
if (declKindCase_ == 2) {
return (com.google.api.expr.v1alpha1.Decl.IdentDecl) declKind_;
}
return com.google.api.expr.v1alpha1.Decl.IdentDecl.getDefaultInstance();
}
public static final int FUNCTION_FIELD_NUMBER = 3;
/**
*
* Function declaration.
*
*
* .google.api.expr.v1alpha1.Decl.FunctionDecl function = 3;
* @return Whether the function field is set.
*/
@java.lang.Override
public boolean hasFunction() {
return declKindCase_ == 3;
}
/**
*
* Function declaration.
*
*
* .google.api.expr.v1alpha1.Decl.FunctionDecl function = 3;
* @return The function.
*/
@java.lang.Override
public com.google.api.expr.v1alpha1.Decl.FunctionDecl getFunction() {
if (declKindCase_ == 3) {
return (com.google.api.expr.v1alpha1.Decl.FunctionDecl) declKind_;
}
return com.google.api.expr.v1alpha1.Decl.FunctionDecl.getDefaultInstance();
}
/**
*
* Function declaration.
*
*
* .google.api.expr.v1alpha1.Decl.FunctionDecl function = 3;
*/
@java.lang.Override
public com.google.api.expr.v1alpha1.Decl.FunctionDeclOrBuilder getFunctionOrBuilder() {
if (declKindCase_ == 3) {
return (com.google.api.expr.v1alpha1.Decl.FunctionDecl) declKind_;
}
return com.google.api.expr.v1alpha1.Decl.FunctionDecl.getDefaultInstance();
}
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 {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
if (declKindCase_ == 2) {
output.writeMessage(2, (com.google.api.expr.v1alpha1.Decl.IdentDecl) declKind_);
}
if (declKindCase_ == 3) {
output.writeMessage(3, (com.google.api.expr.v1alpha1.Decl.FunctionDecl) declKind_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
if (declKindCase_ == 2) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, (com.google.api.expr.v1alpha1.Decl.IdentDecl) declKind_);
}
if (declKindCase_ == 3) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, (com.google.api.expr.v1alpha1.Decl.FunctionDecl) declKind_);
}
size += unknownFields.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.Decl)) {
return super.equals(obj);
}
com.google.api.expr.v1alpha1.Decl other = (com.google.api.expr.v1alpha1.Decl) obj;
if (!getName()
.equals(other.getName())) return false;
if (!getDeclKindCase().equals(other.getDeclKindCase())) return false;
switch (declKindCase_) {
case 2:
if (!getIdent()
.equals(other.getIdent())) return false;
break;
case 3:
if (!getFunction()
.equals(other.getFunction())) return false;
break;
case 0:
default:
}
if (!unknownFields.equals(other.unknownFields)) 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) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
switch (declKindCase_) {
case 2:
hash = (37 * hash) + IDENT_FIELD_NUMBER;
hash = (53 * hash) + getIdent().hashCode();
break;
case 3:
hash = (37 * hash) + FUNCTION_FIELD_NUMBER;
hash = (53 * hash) + getFunction().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.api.expr.v1alpha1.Decl parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.expr.v1alpha1.Decl 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.Decl parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.expr.v1alpha1.Decl 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.Decl parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.expr.v1alpha1.Decl 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.Decl parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.api.expr.v1alpha1.Decl 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.Decl parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.api.expr.v1alpha1.Decl 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.Decl 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.Decl 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.Decl 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;
}
/**
*
* Represents a declaration of a named value or function.
* A declaration is part of the contract between the expression, the agent
* evaluating that expression, and the caller requesting evaluation.
*
*
* Protobuf type {@code google.api.expr.v1alpha1.Decl}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:google.api.expr.v1alpha1.Decl)
com.google.api.expr.v1alpha1.DeclOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.api.expr.v1alpha1.DeclProto.internal_static_google_api_expr_v1alpha1_Decl_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.api.expr.v1alpha1.DeclProto.internal_static_google_api_expr_v1alpha1_Decl_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.api.expr.v1alpha1.Decl.class, com.google.api.expr.v1alpha1.Decl.Builder.class);
}
// Construct using com.google.api.expr.v1alpha1.Decl.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
name_ = "";
declKindCase_ = 0;
declKind_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.api.expr.v1alpha1.DeclProto.internal_static_google_api_expr_v1alpha1_Decl_descriptor;
}
@java.lang.Override
public com.google.api.expr.v1alpha1.Decl getDefaultInstanceForType() {
return com.google.api.expr.v1alpha1.Decl.getDefaultInstance();
}
@java.lang.Override
public com.google.api.expr.v1alpha1.Decl build() {
com.google.api.expr.v1alpha1.Decl result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.api.expr.v1alpha1.Decl buildPartial() {
com.google.api.expr.v1alpha1.Decl result = new com.google.api.expr.v1alpha1.Decl(this);
result.name_ = name_;
if (declKindCase_ == 2) {
if (identBuilder_ == null) {
result.declKind_ = declKind_;
} else {
result.declKind_ = identBuilder_.build();
}
}
if (declKindCase_ == 3) {
if (functionBuilder_ == null) {
result.declKind_ = declKind_;
} else {
result.declKind_ = functionBuilder_.build();
}
}
result.declKindCase_ = declKindCase_;
onBuilt();
return result;
}
@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.Decl) {
return mergeFrom((com.google.api.expr.v1alpha1.Decl)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.api.expr.v1alpha1.Decl other) {
if (other == com.google.api.expr.v1alpha1.Decl.getDefaultInstance()) return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
onChanged();
}
switch (other.getDeclKindCase()) {
case IDENT: {
mergeIdent(other.getIdent());
break;
}
case FUNCTION: {
mergeFunction(other.getFunction());
break;
}
case DECLKIND_NOT_SET: {
break;
}
}
this.mergeUnknownFields(other.unknownFields);
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 {
com.google.api.expr.v1alpha1.Decl parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.api.expr.v1alpha1.Decl) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int declKindCase_ = 0;
private java.lang.Object declKind_;
public DeclKindCase
getDeclKindCase() {
return DeclKindCase.forNumber(
declKindCase_);
}
public Builder clearDeclKind() {
declKindCase_ = 0;
declKind_ = null;
onChanged();
return this;
}
private java.lang.Object name_ = "";
/**
*
* The fully qualified name of the declaration.
* Declarations are organized in containers and this represents the full path
* to the declaration in its container, as in `google.api.expr.Decl`.
* Declarations used as
* [FunctionDecl.Overload][google.api.expr.v1alpha1.Decl.FunctionDecl.Overload]
* parameters may or may not have a name depending on whether the overload is
* function declaration or a function definition containing a result
* [Expr][google.api.expr.v1alpha1.Expr].
*
*
* string name = 1;
* @return The name.
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* The fully qualified name of the declaration.
* Declarations are organized in containers and this represents the full path
* to the declaration in its container, as in `google.api.expr.Decl`.
* Declarations used as
* [FunctionDecl.Overload][google.api.expr.v1alpha1.Decl.FunctionDecl.Overload]
* parameters may or may not have a name depending on whether the overload is
* function declaration or a function definition containing a result
* [Expr][google.api.expr.v1alpha1.Expr].
*
*
* string name = 1;
* @return The bytes for name.
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The fully qualified name of the declaration.
* Declarations are organized in containers and this represents the full path
* to the declaration in its container, as in `google.api.expr.Decl`.
* Declarations used as
* [FunctionDecl.Overload][google.api.expr.v1alpha1.Decl.FunctionDecl.Overload]
* parameters may or may not have a name depending on whether the overload is
* function declaration or a function definition containing a result
* [Expr][google.api.expr.v1alpha1.Expr].
*
*
* string name = 1;
* @param value The name to set.
* @return This builder for chaining.
*/
public Builder setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
onChanged();
return this;
}
/**
*
* The fully qualified name of the declaration.
* Declarations are organized in containers and this represents the full path
* to the declaration in its container, as in `google.api.expr.Decl`.
* Declarations used as
* [FunctionDecl.Overload][google.api.expr.v1alpha1.Decl.FunctionDecl.Overload]
* parameters may or may not have a name depending on whether the overload is
* function declaration or a function definition containing a result
* [Expr][google.api.expr.v1alpha1.Expr].
*
*
* string name = 1;
* @return This builder for chaining.
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
*
* The fully qualified name of the declaration.
* Declarations are organized in containers and this represents the full path
* to the declaration in its container, as in `google.api.expr.Decl`.
* Declarations used as
* [FunctionDecl.Overload][google.api.expr.v1alpha1.Decl.FunctionDecl.Overload]
* parameters may or may not have a name depending on whether the overload is
* function declaration or a function definition containing a result
* [Expr][google.api.expr.v1alpha1.Expr].
*
*
* string name = 1;
* @param value The bytes for name to set.
* @return This builder for chaining.
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
onChanged();
return this;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.api.expr.v1alpha1.Decl.IdentDecl, com.google.api.expr.v1alpha1.Decl.IdentDecl.Builder, com.google.api.expr.v1alpha1.Decl.IdentDeclOrBuilder> identBuilder_;
/**
*
* Identifier declaration.
*
*
* .google.api.expr.v1alpha1.Decl.IdentDecl ident = 2;
* @return Whether the ident field is set.
*/
@java.lang.Override
public boolean hasIdent() {
return declKindCase_ == 2;
}
/**
*
* Identifier declaration.
*
*
* .google.api.expr.v1alpha1.Decl.IdentDecl ident = 2;
* @return The ident.
*/
@java.lang.Override
public com.google.api.expr.v1alpha1.Decl.IdentDecl getIdent() {
if (identBuilder_ == null) {
if (declKindCase_ == 2) {
return (com.google.api.expr.v1alpha1.Decl.IdentDecl) declKind_;
}
return com.google.api.expr.v1alpha1.Decl.IdentDecl.getDefaultInstance();
} else {
if (declKindCase_ == 2) {
return identBuilder_.getMessage();
}
return com.google.api.expr.v1alpha1.Decl.IdentDecl.getDefaultInstance();
}
}
/**
*
*
* .google.api.expr.v1alpha1.Decl.FunctionDecl function = 3;
* @return Whether the function field is set.
*/
@java.lang.Override
public boolean hasFunction() {
return declKindCase_ == 3;
}
/**
*
* Function declaration.
*
*
* .google.api.expr.v1alpha1.Decl.FunctionDecl function = 3;
* @return The function.
*/
@java.lang.Override
public com.google.api.expr.v1alpha1.Decl.FunctionDecl getFunction() {
if (functionBuilder_ == null) {
if (declKindCase_ == 3) {
return (com.google.api.expr.v1alpha1.Decl.FunctionDecl) declKind_;
}
return com.google.api.expr.v1alpha1.Decl.FunctionDecl.getDefaultInstance();
} else {
if (declKindCase_ == 3) {
return functionBuilder_.getMessage();
}
return com.google.api.expr.v1alpha1.Decl.FunctionDecl.getDefaultInstance();
}
}
/**
*
* Function declaration.
*
*
* .google.api.expr.v1alpha1.Decl.FunctionDecl function = 3;
*/
public Builder setFunction(com.google.api.expr.v1alpha1.Decl.FunctionDecl value) {
if (functionBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
declKind_ = value;
onChanged();
} else {
functionBuilder_.setMessage(value);
}
declKindCase_ = 3;
return this;
}
/**
*