com.google.api.CustomErrorRule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grpc-core-proto Show documentation
Show all versions of grpc-core-proto Show documentation
GoogleAPI classes generated from core protos
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/api/error.proto
package com.google.api;
/**
* Protobuf type {@code google.api.CustomErrorRule}
*
*
* A custom error rule.
*
*/
public final class CustomErrorRule extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:google.api.CustomErrorRule)
CustomErrorRuleOrBuilder {
// Use CustomErrorRule.newBuilder() to construct.
private CustomErrorRule(com.google.protobuf.GeneratedMessage.Builder> builder) {
super(builder);
}
private CustomErrorRule() {
selector_ = "";
stubbyBridge_ = 0;
isErrorType_ = false;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private CustomErrorRule(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 10: {
String s = input.readStringRequireUtf8();
selector_ = s;
break;
}
case 16: {
stubbyBridge_ = input.readInt32();
break;
}
case 24: {
isErrorType_ = input.readBool();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw new RuntimeException(e.setUnfinishedMessage(this));
} catch (java.io.IOException e) {
throw new RuntimeException(
new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this));
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.api.ErrorFormatProto.internal_static_google_api_CustomErrorRule_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.api.ErrorFormatProto.internal_static_google_api_CustomErrorRule_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.api.CustomErrorRule.class, com.google.api.CustomErrorRule.Builder.class);
}
public static final int SELECTOR_FIELD_NUMBER = 1;
private volatile java.lang.Object selector_;
/**
* optional string selector = 1;
*
*
* Selects messages to which this rule applies.
* Refer to [selector][DocumentationRule.selector] for syntax details.
*
*/
public java.lang.String getSelector() {
java.lang.Object ref = selector_;
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();
selector_ = s;
return s;
}
}
/**
* optional string selector = 1;
*
*
* Selects messages to which this rule applies.
* Refer to [selector][DocumentationRule.selector] for syntax details.
*
*/
public com.google.protobuf.ByteString
getSelectorBytes() {
java.lang.Object ref = selector_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
selector_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int STUBBY_BRIDGE_FIELD_NUMBER = 2;
private int stubbyBridge_;
/**
* optional int32 stubby_bridge = 2 [deprecated = true];
*
*
* (--The Stubby bridge of the message.--)
*
*/
@java.lang.Deprecated public int getStubbyBridge() {
return stubbyBridge_;
}
public static final int IS_ERROR_TYPE_FIELD_NUMBER = 3;
private boolean isErrorType_;
/**
* optional bool is_error_type = 3;
*
*
* Mark this message as possible payload in error response. Otherwise,
* objects of this type will be filtered when they appear in error payload.
*
*/
public boolean getIsErrorType() {
return isErrorType_;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getSelectorBytes().isEmpty()) {
com.google.protobuf.GeneratedMessage.writeString(output, 1, selector_);
}
if (stubbyBridge_ != 0) {
output.writeInt32(2, stubbyBridge_);
}
if (isErrorType_ != false) {
output.writeBool(3, isErrorType_);
}
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getSelectorBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, selector_);
}
if (stubbyBridge_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(2, stubbyBridge_);
}
if (isErrorType_ != false) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(3, isErrorType_);
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
public static com.google.api.CustomErrorRule parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.CustomErrorRule 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.CustomErrorRule parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.CustomErrorRule parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.api.CustomErrorRule parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static com.google.api.CustomErrorRule parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static com.google.api.CustomErrorRule parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static com.google.api.CustomErrorRule parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static com.google.api.CustomErrorRule parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static com.google.api.CustomErrorRule parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.api.CustomErrorRule prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code google.api.CustomErrorRule}
*
*
* A custom error rule.
*
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder implements
// @@protoc_insertion_point(builder_implements:google.api.CustomErrorRule)
com.google.api.CustomErrorRuleOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.api.ErrorFormatProto.internal_static_google_api_CustomErrorRule_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.api.ErrorFormatProto.internal_static_google_api_CustomErrorRule_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.api.CustomErrorRule.class, com.google.api.CustomErrorRule.Builder.class);
}
// Construct using com.google.api.CustomErrorRule.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
selector_ = "";
stubbyBridge_ = 0;
isErrorType_ = false;
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.api.ErrorFormatProto.internal_static_google_api_CustomErrorRule_descriptor;
}
public com.google.api.CustomErrorRule getDefaultInstanceForType() {
return com.google.api.CustomErrorRule.getDefaultInstance();
}
public com.google.api.CustomErrorRule build() {
com.google.api.CustomErrorRule result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public com.google.api.CustomErrorRule buildPartial() {
com.google.api.CustomErrorRule result = new com.google.api.CustomErrorRule(this);
result.selector_ = selector_;
result.stubbyBridge_ = stubbyBridge_;
result.isErrorType_ = isErrorType_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.api.CustomErrorRule) {
return mergeFrom((com.google.api.CustomErrorRule)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.api.CustomErrorRule other) {
if (other == com.google.api.CustomErrorRule.getDefaultInstance()) return this;
if (!other.getSelector().isEmpty()) {
selector_ = other.selector_;
onChanged();
}
if (other.getStubbyBridge() != 0) {
setStubbyBridge(other.getStubbyBridge());
}
if (other.getIsErrorType() != false) {
setIsErrorType(other.getIsErrorType());
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.api.CustomErrorRule parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.api.CustomErrorRule) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private java.lang.Object selector_ = "";
/**
* optional string selector = 1;
*
*
* Selects messages to which this rule applies.
* Refer to [selector][DocumentationRule.selector] for syntax details.
*
*/
public java.lang.String getSelector() {
java.lang.Object ref = selector_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
selector_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* optional string selector = 1;
*
*
* Selects messages to which this rule applies.
* Refer to [selector][DocumentationRule.selector] for syntax details.
*
*/
public com.google.protobuf.ByteString
getSelectorBytes() {
java.lang.Object ref = selector_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
selector_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* optional string selector = 1;
*
*
* Selects messages to which this rule applies.
* Refer to [selector][DocumentationRule.selector] for syntax details.
*
*/
public Builder setSelector(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
selector_ = value;
onChanged();
return this;
}
/**
* optional string selector = 1;
*
*
* Selects messages to which this rule applies.
* Refer to [selector][DocumentationRule.selector] for syntax details.
*
*/
public Builder clearSelector() {
selector_ = getDefaultInstance().getSelector();
onChanged();
return this;
}
/**
* optional string selector = 1;
*
*
* Selects messages to which this rule applies.
* Refer to [selector][DocumentationRule.selector] for syntax details.
*
*/
public Builder setSelectorBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
selector_ = value;
onChanged();
return this;
}
private int stubbyBridge_ ;
/**
* optional int32 stubby_bridge = 2 [deprecated = true];
*
*
* (--The Stubby bridge of the message.--)
*
*/
@java.lang.Deprecated public int getStubbyBridge() {
return stubbyBridge_;
}
/**
* optional int32 stubby_bridge = 2 [deprecated = true];
*
*
* (--The Stubby bridge of the message.--)
*
*/
@java.lang.Deprecated public Builder setStubbyBridge(int value) {
stubbyBridge_ = value;
onChanged();
return this;
}
/**
* optional int32 stubby_bridge = 2 [deprecated = true];
*
*
* (--The Stubby bridge of the message.--)
*
*/
@java.lang.Deprecated public Builder clearStubbyBridge() {
stubbyBridge_ = 0;
onChanged();
return this;
}
private boolean isErrorType_ ;
/**
* optional bool is_error_type = 3;
*
*
* Mark this message as possible payload in error response. Otherwise,
* objects of this type will be filtered when they appear in error payload.
*
*/
public boolean getIsErrorType() {
return isErrorType_;
}
/**
* optional bool is_error_type = 3;
*
*
* Mark this message as possible payload in error response. Otherwise,
* objects of this type will be filtered when they appear in error payload.
*
*/
public Builder setIsErrorType(boolean value) {
isErrorType_ = value;
onChanged();
return this;
}
/**
* optional bool is_error_type = 3;
*
*
* Mark this message as possible payload in error response. Otherwise,
* objects of this type will be filtered when they appear in error payload.
*
*/
public Builder clearIsErrorType() {
isErrorType_ = false;
onChanged();
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:google.api.CustomErrorRule)
}
// @@protoc_insertion_point(class_scope:google.api.CustomErrorRule)
private static final com.google.api.CustomErrorRule DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.api.CustomErrorRule();
}
public static com.google.api.CustomErrorRule getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
public CustomErrorRule parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
try {
return new CustomErrorRule(input, extensionRegistry);
} catch (RuntimeException e) {
if (e.getCause() instanceof
com.google.protobuf.InvalidProtocolBufferException) {
throw (com.google.protobuf.InvalidProtocolBufferException)
e.getCause();
}
throw e;
}
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
public com.google.api.CustomErrorRule getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}